readFromFileSync method

dynamic readFromFileSync(
  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

dynamic readFromFileSync(
  final String fileFolder,
  final String fileName, {
  final bool byteMode = false,
}) {
  final _file = _openFileSync(fileFolder, fileName);

  return byteMode ? _file.readAsBytesSync() : _file.readAsStringSync();
}