hwFetchBlobData function

Future<Uint8List?> hwFetchBlobData(
  1. String url
)

Implementation

Future<Uint8List?> hwFetchBlobData(String url) async {
  final response = await HttpRequest.request(
    url,
    responseType: 'arraybuffer',
  );

  if (response.status == 200) {
    final byteBuffer = response.response;
    return byteBuffer.asUint8List();
  } else {
    throw Exception("Failed Blob $url");
  }
}