readAsset method

  1. @override
Future<Uint8List> readAsset(
  1. Uri uri
)
override

Read asset binary data.

Returns the raw bytes of the asset. Throws AssetNotFoundException if asset doesn't exist.

Implementation

@override
Future<Uint8List> readAsset(Uri uri) async {
  final key = uri.toString();
  final asset = _assets[key];
  if (asset == null) {
    throw AssetNotFoundException(uri);
  }
  return Uint8List.fromList(asset);
}