loadBuffer method

  1. @override
Future<ImmutableBuffer> loadBuffer(
  1. String key
)
override

Retrieve a binary resource from the asset bundle as an immutable buffer.

Throws an exception if the asset is not found.

Implementation

@override
Future<ui.ImmutableBuffer> loadBuffer(String key) async {
  final ByteData data = await load(key);
  return ui.ImmutableBuffer.fromUint8List(Uint8List.sublistView(data));
}