decodeGzipBase64 function

Future<Uint8List> decodeGzipBase64(
  1. String encoded
)

Implementation

Future<Uint8List> decodeGzipBase64(String encoded) async {
  final Uint8List bytes = base64.decode(encoded);
  final source = _Response(bytes.toJS);
  final readable = source.body!;
  final decompressed = readable.pipeThrough(_DecompressionStream('gzip'));
  final buffer = await _Response(decompressed).arrayBuffer().toDart;
  return buffer.toDart.asUint8List();
}