Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unsupported operation: _newZLibDeflateFilter, what is this?

This is getting passed back from my exception. This only occurs on web, on ios and android it works perfectly.

Any insight on how to correct this or point me in the right direction will be appreciated.

like image 415
Jason Spick Avatar asked Nov 07 '25 04:11

Jason Spick


1 Answers

_newZLibDeflateFilter means that you are using GZipCodec() which related to dart:io library that's currently doesn't support flutter web, in order to decompress your http response you can use archive package

include the package in your YAML file

dependencies:
  archive: ^3.3.2

and use GZipDecoder() that's included in the package instead of dart:io GZipCodec()

import 'package:archive/archive_io.dart';
String responseBodyDecompressed = utf8.decode(
    GZipDecoder().decodeBytes(response.bodyBytes) //decompression
    );
like image 168
Ali Kamal Avatar answered Nov 09 '25 08:11

Ali Kamal