blobUrlToUint8List function
Implementation
Future<Uint8List> blobUrlToUint8List(String url) async {
final html.HttpRequest request = await html.HttpRequest.request(
url,
responseType: "blob",
);
final html.Blob blobData = request.response as html.Blob;
final reader = html.FileReader();
final completer = Completer<Uint8List>();
reader.readAsArrayBuffer(blobData);
reader.onLoadEnd.listen((_) {
completer.complete(reader.result as Uint8List);
});
return await completer.future;
}