readBinaryFile method

Future<List<int>> readBinaryFile (
  1. String fileName
)

Reads a binary file from assets folder

Implementation

Future<List<int>> readBinaryFile(String fileName) async {
  if (!_files.containsKey(fileName)) {
    _files[fileName] = await _readBinary(fileName);
  }

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

  return _files[fileName].value;
}