getStreamF static method

Future<ByteData> getStreamF(
  1. String key
)

Retrieve a 'ByteData' object by its Key value.

Implementation

static Future<ByteData> getStreamF(String key) async {
  assert(Assets._assets != null, 'Assets.init() must be called first.');
  ByteData data;
  try {
    data = await Assets._assets!.load('$setPath(key)$key');
  } catch (ex) {
    data = ByteData(0);
  }
  return data;
}