MediaUtils class
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited
Static Methods
compressAndroidFile (String path , {int height = 1080 , int width = 1920 , int quality = 95 , KatCompressFormat format = KatCompressFormat.webp })
→ Future <Uint8List ? >
hàm này dùng để compress file ảnh tại path trên Android
compressAndroidList (Uint8List image , {int height = 1080 , int width = 1920 , int quality = 95 , KatCompressFormat format = KatCompressFormat.webp })
→ Future <Uint8List >
hàm này dùng để compress image (Uint8List) trên Android
compressAndroidStream (String assetName , {int height = 768 , int width = 1024 , int quality = 95 , KatCompressFormat format = KatCompressFormat.webp })
→ Future <Uint8List ? >
hàm này dùng để compress một image asset (khai báo trong pubspec) trên Android
compressAndroidVideo (String path )
→ Future <Uint8List ? >
hàm này dùng để compress file video tại path trên Android, huỷ và xoá
cache của lần compress trước đó (nếu có) trước khi bắt đầu
compressBytesAndroid (Uint8List image , {required int imageScaleSize , required int minimumHeight , required int minimumWidth , KatCompressFormat format = KatCompressFormat.webp })
→ Future <Uint8List >
hàm này dùng để compress image trên Android, với quality được tính
toán để ảnh sau khi nén đạt xấp xỉ imageScaleSize MB.
getAssetImageUint8List (String key )
→ Future <Uint8List >
hàm này dùng để đọc một asset (khai báo trong pubspec) ra Uint8List
pickFiles ({bool allowMultiple = false , KatFileType type = KatFileType.any , List <String > ? allowedExtensions })
→ Future <List <KatPlatformFile > >
hàm này dùng để mở picker chọn file từ thiết bị
saveImageToGallery (Uint8List value , String fileName )
→ Future <KatAssetEntity ? >
hàm này dùng để lưu value vào thư viện ảnh (gallery) của thiết bị với
tên file là fileName. Trả về null nếu người dùng không cấp quyền
truy cập thư viện ảnh.