TF-761 Implement reduce image size when add inline image

This commit is contained in:
dab246
2022-07-28 14:36:37 +07:00
committed by Dat H. Pham
parent 8e22bec3f1
commit e050042e2c
12 changed files with 129 additions and 110 deletions
+5 -2
View File
@@ -1,4 +1,6 @@
import 'dart:typed_data';
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
import 'package:mime/mime.dart';
@@ -8,8 +10,9 @@ class FileInfo with EquatableMixin {
final String filePath;
final int fileSize;
final Stream<List<int>>? readStream;
final Uint8List? bytes;
FileInfo(this.fileName, this.filePath, this.fileSize, {this.readStream});
FileInfo(this.fileName, this.filePath, this.fileSize, {this.readStream, this.bytes});
factory FileInfo.empty() {
return FileInfo('', '', 0);
@@ -20,5 +23,5 @@ class FileInfo with EquatableMixin {
String get mimeType => lookupMimeType(kIsWeb ? fileName : filePath) ?? 'application/json; charset=UTF-8';
@override
List<Object?> get props => [fileName, filePath, fileSize, readStream];
List<Object?> get props => [fileName, filePath, fileSize, readStream, bytes];
}