readFile method

Future<String> readFile (
  1. String fileName
)

Reads a file from assets folder

Implementation

Future<String> readFile(String fileName) async {
  if (!_files.containsKey(fileName)) {
    _files[fileName] = await _readFile(fileName);
  }

  assert(
    _files[fileName] is _StringAsset,
    '"$fileName" is not a String Asset',
  );

  return _files[fileName].value;
}