首页 > 解决方案 > 如何在 Flutter Web 程序中压缩图像

问题描述

我尝试在颤动的网络程序中上传图像,但它的大小太大。裁剪后,问题无法解决。图片的数据格式为Uint8List。

标签: imageflutterwebcompression

解决方案


Just using new Plugin name : File_support url : https://pub.dev/packages/file_support

This file support plugin is good when I used first time.It drastically reduce file size 2 mb to 70 kb.

 File compressimage = await FileSupport().compressImage(<Your image file>);

After this code convert File object to Uint8 then upload file.


推荐阅读