ImageCompressUtil class abstract

图片压缩工具类

使用flutter_image_compress库进行图片压缩

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

compressFromAsset(String assetName, {int minWidth = 1920, int minHeight = 1080, int quality = 95, int rotate = 0, bool autoCorrectionAngle = true, CompressFormat format = CompressFormat.jpeg, bool keepExif = false}) Future<Uint8List?>
Compress image from asset of assetName to Uint8List
compressFromBytes(Uint8List image, {int minWidth = 1920, int minHeight = 1080, int quality = 95, int rotate = 0, int inSampleSize = 1, bool autoCorrectionAngle = true, CompressFormat format = CompressFormat.jpeg, bool keepExif = false}) Future<Uint8List>
Compress image from Uint8List to Uint8List.
compressFromFile(String path, {int minWidth = 1920, int minHeight = 1080, int inSampleSize = 1, int quality = 95, int rotate = 0, bool autoCorrectionAngle = true, CompressFormat format = CompressFormat.jpeg, bool keepExif = false, int numberOfRetries = 5}) Future<Uint8List?>
Compress image from file of path to Uint8List.
compressFromFiletoXFile(String path, String targetPath, {int minWidth = 1920, int minHeight = 1080, int inSampleSize = 1, int quality = 95, int rotate = 0, bool autoCorrectionAngle = true, CompressFormat format = CompressFormat.jpeg, bool keepExif = false, int numberOfRetries = 5}) Future<XFile?>
Compress image from file of path to targetPath