how to create empty file in flutter local doirectory code example
Example 1: write and read to file in flutter
Future get _localFile async {
final path = await _localPath;
return File('$path/counter.txt');
}
Example 2: write and read to file in flutter
Future writeCounter(int counter) async {
final file = await _localFile;
// Write the file.
return file.writeAsString('$counter');
}