ImageUtil class

Constructors

ImageUtil()

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

addTextWatermark(File file, String text, {Color color = Colors.white, double fontSize = 18, Offset offset = const Offset(10, 10)}) Future<File>
给图片添加文字水印
addTextWatermarkToBytes(Uint8List bytes, String text, {Color color = Colors.white, double fontSize = 18, Offset offset = const Offset(10, 10)}) Future<Uint8List>
给图片字节数据添加文字水印
captureWidget(GlobalKey<State<StatefulWidget>> key) Future<Uint8List>
截取小部件的图片
compressImageBytes(Uint8List bytes, {int quality = 80}) Future<Uint8List>
压缩图片数据
compressImageFile(File imageFile, {int quality = 80}) Future<File>
压缩图片文件
getImageSize(Object image) Future<Size>
获取图片宽高
isImage(File file) Future<bool>
判断文件是否为图片
isImageFromBytes(Uint8List bytes) bool
从字节数组判断是否为图片
isImageUrl(String imageUrl) Future<bool>
判断图片地址是否为有效的图片
saveNetworkImage(String imageUrl) Future<String>
保存网络图片到本地
saveScreenshot(Uint8List bytes) Future<String>
保存截屏图片到本地