fetch method

Future<Uint8List> fetch({
  1. CdnFormat? format,
  2. int? size,
})

Fetch this asset and return its binary data.

Implementation

Future<Uint8List> fetch({CdnFormat? format, int? size}) async {
  assert(format != CdnFormat.gif || isAnimated, 'Asset must be animated to fetch as GIF');

  final request = _getRequest(format ?? defaultFormat, size);

  final response = await client.httpHandler.executeSafe(request);
  return response.body;
}