TF-1808: Hanlde store email when opening email
(cherry picked from commit 2c895379f83b34e9bafb7545b21d790d01d444af)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user