FileUtil class

文件操作类

Constructors

FileUtil()

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

captureImage2List(File imgFile) Future<Uint8List>
图片路径转 Uint8List 数据
captureImagePath2List(String imgFilePath) Future<Uint8List>
图片路径转 Uint8List 数据
capturePng2List(RenderRepaintBoundary boundary) Future<Uint8List?>
RenderRepaintBoundary 内容转换为 Uint8List 数据
compressWithFile(String imageFilePath, {int minWidth = 1920, int minHeight = 1080, int quality = 95, int rotate = 0}) Future<File?>
压缩图片,返回存储的临时路径
compressWithList(Uint8List imageData, {int minWidth = 1920, int minHeight = 1080, int quality = 95, int rotate = 0}) Future<File>
压缩图片,返回存储的临时路径
deleteFile(String filePath) → void
saveImg(List<int> bytes, [String fileDir = 'compress']) Future<File>