fromAsset method Null safety

Future<ImmutableBuffer> fromAsset(
  1. String assetKey
)

Create a buffer from the asset with key assetKey.

Throws an Exception if the asset does not exist.

Implementation

static Future<ImmutableBuffer> fromAsset(String assetKey) {
  final ImmutableBuffer instance = ImmutableBuffer._(0);
  return _futurize((_Callback<int> callback) {
    return instance._initFromAsset(assetKey, callback);
  }).then((int length) => instance.._length = length);
}