loadBuffer method Null safety

Future<ImmutableBuffer> loadBuffer(
  1. String key
)

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

Throws an exception if the asset is not found.

Implementation

Future<ui.ImmutableBuffer> loadBuffer(String key) async {
  final ByteData data = await load(key);
  return ui.ImmutableBuffer.fromUint8List(data.buffer.asUint8List());
}