readFromFile method

Future readFromFile(
  1. String fileFolder,
  2. String fileName, {
  3. bool byteMode = false,
})

Reads from a file and returns the content on the form of a String or Uint8List.

Before reading, it checks whether the file exists or not.

Implementation

Future<dynamic> readFromFile(
  final String fileFolder,
  final String fileName, {
  final bool byteMode = false,
}) async {
  final _file = await _openFile(fileFolder, fileName);

  return byteMode ? await _file.readAsBytes() : await _file.readAsString();
}