TF-1808: Hanlde store email when opening email

(cherry picked from commit 2c895379f83b34e9bafb7545b21d790d01d444af)
This commit is contained in:
HuyNguyen
2023-05-11 17:27:42 +07:00
committed by Dat Vu
parent 28d75ce384
commit 63f375a29c
22 changed files with 215 additions and 95 deletions
+15 -1
View File
@@ -55,7 +55,7 @@ class FileUtils {
return await file.writeAsString(content, mode: FileMode.append);
}
Future<String> getFromFile({
Future<String> getContentFromFile({
required String nameFile,
String? folderPath,
String? extensionFile
@@ -73,6 +73,20 @@ class FileUtils {
return emailContent;
}
Future<bool> isFileExisted({
required String nameFile,
String? folderPath,
String? extensionFile
}) async {
final internalStorageDirPath = await _getInternalStorageDirPath(
nameFile: nameFile,
folderPath: folderPath,
extensionFile: extensionFile
);
return File(internalStorageDirPath).exists();
}
}
enum ExtensionType {
+1 -1
View File
@@ -30,7 +30,7 @@ void main() {
/// Create a temporary file that will be deleted after `getFromFile` is done
final file = await FileUtils().saveToFile(nameFile: fileName, content: fileContent);
final htmlString = await FileUtils().getFromFile(nameFile: fileName);
final htmlString = await FileUtils().getContentFromFile(nameFile: fileName);
expect(htmlString.isNotEmpty, equals(true));