Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dart Read data from the file

Future<int> readCounter() async {
  try {
    final file = await _localFile;

    // Read the file
    final contents = await file.readAsString();

    return int.parse(contents);
  } catch (e) {
    // If encountering an error, return 0
    return 0;
  }
}
Source by docs.flutter.dev #
 
PREVIOUS NEXT
Tagged: #dart #Read #data #file
ADD COMMENT
Topic
Name
1+7 =