TF-2602 Set charset for attachment with mimeType=text/plain when sent email on web
This commit is contained in:
+14
-6
@@ -337,10 +337,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_charset_detector
|
name: flutter_charset_detector
|
||||||
sha256: "45de8a4b4255c1ea850a30955e7456091899ed4ff8b75593e14ec59f629b4b56"
|
sha256: "5d4796d43dac2f37e14149b0f0c676fa08e8eb1ada8e99342a838d971d2fb9b1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "3.0.0"
|
||||||
flutter_charset_detector_android:
|
flutter_charset_detector_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -349,14 +349,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.1"
|
||||||
flutter_charset_detector_ios:
|
flutter_charset_detector_darwin:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_charset_detector_ios
|
name: flutter_charset_detector_darwin
|
||||||
sha256: e0e2c7b819cd1f7c9a50da94bf7f0e6d7a095eb64e81196ec758e77793903d43
|
sha256: daac20390275efb92fbb14350fe11286c5e29c7b80d6b0867f52d760f0d69763
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.1.0"
|
||||||
flutter_charset_detector_platform_interface:
|
flutter_charset_detector_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -365,6 +365,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
flutter_charset_detector_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_charset_detector_web
|
||||||
|
sha256: d8495115abada771c75f9395aae3e5809ffd506e8fc8f62b403ae11fc29e1d2b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
flutter_image_compress:
|
flutter_image_compress:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import 'package:flutter_charset_detector/flutter_charset_detector.dart';
|
|||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
class FileUtils {
|
class FileUtils {
|
||||||
static const String DEFAULT_CHARSET = 'UTF-8';
|
static const String DEFAULT_CHARSET = 'uft-8';
|
||||||
static const String TEXT_PLAIN_MIME_TYPE = 'text/plain';
|
static const String TEXT_PLAIN_MIME_TYPE = 'text/plain';
|
||||||
|
|
||||||
Future<String> _getInternalStorageDirPath({
|
Future<String> _getInternalStorageDirPath({
|
||||||
@@ -139,14 +139,13 @@ class FileUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> getFileCharset(String filePath) async {
|
Future<String> getCharsetFromBytes(Uint8List bytes) async {
|
||||||
try {
|
try {
|
||||||
final file = File(filePath);
|
final decodedResult = await CharsetDetector.autoDecode(bytes);
|
||||||
final decodingResult = await CharsetDetector.autoDecode(file.readAsBytesSync());
|
log('FileUtils::getCharsetFromBytes: FILE_CHARSET = ${decodedResult.charset}');
|
||||||
logError('FileUtils::getFileCharset: FILE_CHARSET = ${decodingResult.charset}');
|
return decodedResult.charset;
|
||||||
return decodingResult.charset;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError('FileUtils::getFileCharset: Exception: $e');
|
logError('FileUtils::getCharsetFromBytes: Exception: $e');
|
||||||
return DEFAULT_CHARSET;
|
return DEFAULT_CHARSET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'dart:js' as js;
|
import 'package:universal_html/js.dart' as js;
|
||||||
|
|
||||||
/// Whether the CanvasKit renderer is being used on web.
|
/// Whether the CanvasKit renderer is being used on web.
|
||||||
///
|
///
|
||||||
|
|||||||
+14
-6
@@ -330,10 +330,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_charset_detector
|
name: flutter_charset_detector
|
||||||
sha256: "45de8a4b4255c1ea850a30955e7456091899ed4ff8b75593e14ec59f629b4b56"
|
sha256: "5d4796d43dac2f37e14149b0f0c676fa08e8eb1ada8e99342a838d971d2fb9b1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "3.0.0"
|
||||||
flutter_charset_detector_android:
|
flutter_charset_detector_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -342,14 +342,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
flutter_charset_detector_ios:
|
flutter_charset_detector_darwin:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_charset_detector_ios
|
name: flutter_charset_detector_darwin
|
||||||
sha256: e0e2c7b819cd1f7c9a50da94bf7f0e6d7a095eb64e81196ec758e77793903d43
|
sha256: d17c1847366a0501449d95d18a43417585841afe10200ceefb4422e6b7fccefb
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.0"
|
||||||
flutter_charset_detector_platform_interface:
|
flutter_charset_detector_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -358,6 +358,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
|
flutter_charset_detector_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_charset_detector_web
|
||||||
|
sha256: d8495115abada771c75f9395aae3e5809ffd506e8fc8f62b403ae11fc29e1d2b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
flutter_image_compress:
|
flutter_image_compress:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@ dependencies:
|
|||||||
|
|
||||||
fk_user_agent: 2.1.0
|
fk_user_agent: 2.1.0
|
||||||
|
|
||||||
flutter_charset_detector: 2.0.0
|
flutter_charset_detector: 3.0.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
+6
-5
@@ -90,8 +90,9 @@ PODS:
|
|||||||
- flutter_appauth (0.0.1):
|
- flutter_appauth (0.0.1):
|
||||||
- AppAuth (= 1.7.4)
|
- AppAuth (= 1.7.4)
|
||||||
- Flutter
|
- Flutter
|
||||||
- flutter_charset_detector_ios (0.0.1):
|
- flutter_charset_detector_darwin (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
- UniversalDetector2 (= 2.0.1)
|
- UniversalDetector2 (= 2.0.1)
|
||||||
- flutter_downloader (0.0.1):
|
- flutter_downloader (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
@@ -205,7 +206,7 @@ DEPENDENCIES:
|
|||||||
- fk_user_agent (from `.symlinks/plugins/fk_user_agent/ios`)
|
- fk_user_agent (from `.symlinks/plugins/fk_user_agent/ios`)
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- flutter_appauth (from `.symlinks/plugins/flutter_appauth/ios`)
|
- flutter_appauth (from `.symlinks/plugins/flutter_appauth/ios`)
|
||||||
- flutter_charset_detector_ios (from `.symlinks/plugins/flutter_charset_detector_ios/ios`)
|
- flutter_charset_detector_darwin (from `.symlinks/plugins/flutter_charset_detector_darwin/darwin`)
|
||||||
- flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`)
|
- flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`)
|
||||||
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
|
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
|
||||||
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
|
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
|
||||||
@@ -273,8 +274,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: Flutter
|
:path: Flutter
|
||||||
flutter_appauth:
|
flutter_appauth:
|
||||||
:path: ".symlinks/plugins/flutter_appauth/ios"
|
:path: ".symlinks/plugins/flutter_appauth/ios"
|
||||||
flutter_charset_detector_ios:
|
flutter_charset_detector_darwin:
|
||||||
:path: ".symlinks/plugins/flutter_charset_detector_ios/ios"
|
:path: ".symlinks/plugins/flutter_charset_detector_darwin/darwin"
|
||||||
flutter_downloader:
|
flutter_downloader:
|
||||||
:path: ".symlinks/plugins/flutter_downloader/ios"
|
:path: ".symlinks/plugins/flutter_downloader/ios"
|
||||||
flutter_image_compress_common:
|
flutter_image_compress_common:
|
||||||
@@ -333,7 +334,7 @@ SPEC CHECKSUMS:
|
|||||||
fk_user_agent: 1f47ec39291e8372b1d692b50084b0d54103c545
|
fk_user_agent: 1f47ec39291e8372b1d692b50084b0d54103c545
|
||||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||||
flutter_appauth: 1ce438877bc111c5d8f42da47729909290624886
|
flutter_appauth: 1ce438877bc111c5d8f42da47729909290624886
|
||||||
flutter_charset_detector_ios: 5157d0104855b9deb78e1395515a287197bc2d55
|
flutter_charset_detector_darwin: fb3692d6d72cb6afcce7b0dd1a9516be6e78556e
|
||||||
flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39
|
flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39
|
||||||
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
|
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
|
||||||
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
|
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:core/data/network/dio_client.dart';
|
import 'package:core/data/network/dio_client.dart';
|
||||||
import 'package:core/data/network/download/download_client.dart';
|
import 'package:core/data/network/download/download_client.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
import 'package:core/utils/application_manager.dart';
|
||||||
|
import 'package:core/utils/file_utils.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:jmap_dart_client/http/http_client.dart';
|
import 'package:jmap_dart_client/http/http_client.dart';
|
||||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||||
@@ -38,7 +39,10 @@ class PublicAssetBindings extends BaseBindings {
|
|||||||
@override
|
@override
|
||||||
void dependencies() {
|
void dependencies() {
|
||||||
Get.lazyPut(
|
Get.lazyPut(
|
||||||
() => FileUploader(Get.find<DioClient>(tag: BindingTag.isolateTag), Get.find<Executor>()),
|
() => FileUploader(
|
||||||
|
Get.find<DioClient>(tag: BindingTag.isolateTag),
|
||||||
|
Get.find<Executor>(),
|
||||||
|
Get.find<FileUtils>()),
|
||||||
tag: BindingTag.publicAssetBindingsTag);
|
tag: BindingTag.publicAssetBindingsTag);
|
||||||
Get.lazyPut(
|
Get.lazyPut(
|
||||||
() => PublicAssetApi(Get.find<HttpClient>(), Get.find<Uuid>()),
|
() => PublicAssetApi(Get.find<HttpClient>(), Get.find<Uuid>()),
|
||||||
|
|||||||
@@ -123,11 +123,13 @@ class FileUploader {
|
|||||||
);
|
);
|
||||||
log('FileUploader::_handleUploadAttachmentAction(): RESULT_JSON = $resultJson');
|
log('FileUploader::_handleUploadAttachmentAction(): RESULT_JSON = $resultJson');
|
||||||
if (argsUpload.mobileFileUpload.mimeType == FileUtils.TEXT_PLAIN_MIME_TYPE) {
|
if (argsUpload.mobileFileUpload.mimeType == FileUtils.TEXT_PLAIN_MIME_TYPE) {
|
||||||
final fileCharset = await argsUpload.fileUtils.getFileCharset(argsUpload.mobileFileUpload.filePath);
|
final fileCharset = await argsUpload.fileUtils.getCharsetFromBytes(
|
||||||
|
File(argsUpload.mobileFileUpload.filePath).readAsBytesSync()
|
||||||
|
);
|
||||||
return _parsingResponse(
|
return _parsingResponse(
|
||||||
resultJson: resultJson,
|
resultJson: resultJson,
|
||||||
fileName: argsUpload.mobileFileUpload.fileName,
|
fileName: argsUpload.mobileFileUpload.fileName,
|
||||||
fileCharset: fileCharset);
|
fileCharset: fileCharset.toLowerCase());
|
||||||
} else {
|
} else {
|
||||||
return _parsingResponse(
|
return _parsingResponse(
|
||||||
resultJson: resultJson,
|
resultJson: resultJson,
|
||||||
@@ -140,7 +142,7 @@ class FileUploader {
|
|||||||
requestOptions: exception.requestOptions.copyWith(data: ''));
|
requestOptions: exception.requestOptions.copyWith(data: ''));
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
logError('FileUploader::_handleUploadAttachmentAction():OtherException: $exception');
|
logError('FileUploader::_handleUploadAttachmentAction():OtherException: $exception');
|
||||||
|
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,8 +183,18 @@ class FileUploader {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
log('FileUploader::_handleUploadAttachmentActionOnWeb():resultJson: $resultJson');
|
log('FileUploader::_handleUploadAttachmentActionOnWeb(): RESULT_JSON = $resultJson');
|
||||||
return _parsingResponse(resultJson: resultJson, fileName: fileInfo.fileName);
|
if (fileInfo.mimeType == FileUtils.TEXT_PLAIN_MIME_TYPE) {
|
||||||
|
final fileCharset = await _fileUtils.getCharsetFromBytes(fileInfo.bytes!);
|
||||||
|
return _parsingResponse(
|
||||||
|
resultJson: resultJson,
|
||||||
|
fileName: fileInfo.fileName,
|
||||||
|
fileCharset: fileCharset.toLowerCase());
|
||||||
|
} else {
|
||||||
|
return _parsingResponse(
|
||||||
|
resultJson: resultJson,
|
||||||
|
fileName: fileInfo.fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Attachment _parsingResponse({
|
static Attachment _parsingResponse({
|
||||||
|
|||||||
+14
-6
@@ -337,10 +337,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_charset_detector
|
name: flutter_charset_detector
|
||||||
sha256: "45de8a4b4255c1ea850a30955e7456091899ed4ff8b75593e14ec59f629b4b56"
|
sha256: "5d4796d43dac2f37e14149b0f0c676fa08e8eb1ada8e99342a838d971d2fb9b1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "3.0.0"
|
||||||
flutter_charset_detector_android:
|
flutter_charset_detector_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -349,14 +349,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.1"
|
||||||
flutter_charset_detector_ios:
|
flutter_charset_detector_darwin:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_charset_detector_ios
|
name: flutter_charset_detector_darwin
|
||||||
sha256: e0e2c7b819cd1f7c9a50da94bf7f0e6d7a095eb64e81196ec758e77793903d43
|
sha256: daac20390275efb92fbb14350fe11286c5e29c7b80d6b0867f52d760f0d69763
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.1.0"
|
||||||
flutter_charset_detector_platform_interface:
|
flutter_charset_detector_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -365,6 +365,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
flutter_charset_detector_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_charset_detector_web
|
||||||
|
sha256: d8495115abada771c75f9395aae3e5809ffd506e8fc8f62b403ae11fc29e1d2b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
flutter_image_compress:
|
flutter_image_compress:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
+14
-6
@@ -659,10 +659,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_charset_detector
|
name: flutter_charset_detector
|
||||||
sha256: "45de8a4b4255c1ea850a30955e7456091899ed4ff8b75593e14ec59f629b4b56"
|
sha256: "5d4796d43dac2f37e14149b0f0c676fa08e8eb1ada8e99342a838d971d2fb9b1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "3.0.0"
|
||||||
flutter_charset_detector_android:
|
flutter_charset_detector_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -671,14 +671,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
flutter_charset_detector_ios:
|
flutter_charset_detector_darwin:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_charset_detector_ios
|
name: flutter_charset_detector_darwin
|
||||||
sha256: e0e2c7b819cd1f7c9a50da94bf7f0e6d7a095eb64e81196ec758e77793903d43
|
sha256: d17c1847366a0501449d95d18a43417585841afe10200ceefb4422e6b7fccefb
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.0"
|
||||||
flutter_charset_detector_platform_interface:
|
flutter_charset_detector_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -687,6 +687,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
|
flutter_charset_detector_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_charset_detector_web
|
||||||
|
sha256: d8495115abada771c75f9395aae3e5809ffd506e8fc8f62b403ae11fc29e1d2b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
flutter_colorpicker:
|
flutter_colorpicker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:core/presentation/utils/responsive_utils.dart';
|
|||||||
import 'package:core/utils/application_manager.dart';
|
import 'package:core/utils/application_manager.dart';
|
||||||
import 'package:core/utils/platform_info.dart';
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:dartz/dartz.dart' hide State;
|
import 'package:dartz/dartz.dart' hide State;
|
||||||
|
import 'package:core/utils/file_utils.dart';
|
||||||
import 'package:flutter/widgets.dart' hide State;
|
import 'package:flutter/widgets.dart' hide State;
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -74,6 +75,7 @@ import 'identity_creator_controller_test.mocks.dart';
|
|||||||
MockSpec<IdentityUtils>(),
|
MockSpec<IdentityUtils>(),
|
||||||
MockSpec<DioClient>(),
|
MockSpec<DioClient>(),
|
||||||
MockSpec<Executor>(),
|
MockSpec<Executor>(),
|
||||||
|
MockSpec<FileUtils>(),
|
||||||
MockSpec<RemoteExceptionThrower>(),
|
MockSpec<RemoteExceptionThrower>(),
|
||||||
MockSpec<DownloadClient>(),
|
MockSpec<DownloadClient>(),
|
||||||
MockSpec<HtmlAnalyzer>(),
|
MockSpec<HtmlAnalyzer>(),
|
||||||
@@ -155,6 +157,7 @@ void main() {
|
|||||||
|
|
||||||
Get.put<DioClient>(MockDioClient(), tag: BindingTag.isolateTag);
|
Get.put<DioClient>(MockDioClient(), tag: BindingTag.isolateTag);
|
||||||
Get.put<Executor>(MockExecutor());
|
Get.put<Executor>(MockExecutor());
|
||||||
|
Get.put<FileUtils>(MockFileUtils());
|
||||||
Get.put<RemoteExceptionThrower>(MockRemoteExceptionThrower());
|
Get.put<RemoteExceptionThrower>(MockRemoteExceptionThrower());
|
||||||
Get.put<DownloadClient>(MockDownloadClient());
|
Get.put<DownloadClient>(MockDownloadClient());
|
||||||
Get.put<HtmlAnalyzer>(MockHtmlAnalyzer());
|
Get.put<HtmlAnalyzer>(MockHtmlAnalyzer());
|
||||||
@@ -182,7 +185,7 @@ void main() {
|
|||||||
true,
|
true,
|
||||||
{CapabilityIdentifier.jmapPublicAsset: DefaultCapability({})});
|
{CapabilityIdentifier.jmapPublicAsset: DefaultCapability({})});
|
||||||
final session = Session(
|
final session = Session(
|
||||||
{},
|
{},
|
||||||
{accountId: account},
|
{accountId: account},
|
||||||
{}, UserName('value'), Uri(), Uri(), Uri(), Uri(), State('value'));
|
{}, UserName('value'), Uri(), Uri(), Uri(), Uri(), State('value'));
|
||||||
|
|
||||||
@@ -271,14 +274,14 @@ void main() {
|
|||||||
final context = MockBuildContext();
|
final context = MockBuildContext();
|
||||||
identityCreatorController.updateNameIdentity(context, identityName);
|
identityCreatorController.updateNameIdentity(context, identityName);
|
||||||
identityCreatorController.updateContentHtmlEditor(htmlContent);
|
identityCreatorController.updateContentHtmlEditor(htmlContent);
|
||||||
|
|
||||||
identityCreatorController.onUnloadBrowserListener(Event(''));
|
identityCreatorController.onUnloadBrowserListener(Event(''));
|
||||||
await untilCalled(mockSaveIdentityCacheOnWebInteractor.execute(
|
await untilCalled(mockSaveIdentityCacheOnWebInteractor.execute(
|
||||||
any,
|
any,
|
||||||
any,
|
any,
|
||||||
identityCache: anyNamed('identityCache'),
|
identityCache: anyNamed('identityCache'),
|
||||||
));
|
));
|
||||||
|
|
||||||
// assert
|
// assert
|
||||||
verify(mockSaveIdentityCacheOnWebInteractor.execute(
|
verify(mockSaveIdentityCacheOnWebInteractor.execute(
|
||||||
accountId,
|
accountId,
|
||||||
@@ -321,14 +324,14 @@ void main() {
|
|||||||
final context = MockBuildContext();
|
final context = MockBuildContext();
|
||||||
identityCreatorController.updateNameIdentity(context, identityName);
|
identityCreatorController.updateNameIdentity(context, identityName);
|
||||||
identityCreatorController.updateContentHtmlEditor(htmlContent);
|
identityCreatorController.updateContentHtmlEditor(htmlContent);
|
||||||
|
|
||||||
identityCreatorController.onBeforeReconnect();
|
identityCreatorController.onBeforeReconnect();
|
||||||
await untilCalled(mockSaveIdentityCacheOnWebInteractor.execute(
|
await untilCalled(mockSaveIdentityCacheOnWebInteractor.execute(
|
||||||
any,
|
any,
|
||||||
any,
|
any,
|
||||||
identityCache: anyNamed('identityCache'),
|
identityCache: anyNamed('identityCache'),
|
||||||
));
|
));
|
||||||
|
|
||||||
// assert
|
// assert
|
||||||
verify(mockSaveIdentityCacheOnWebInteractor.execute(
|
verify(mockSaveIdentityCacheOnWebInteractor.execute(
|
||||||
accountId,
|
accountId,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
|
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
|
||||||
|
|
||||||
<script type="application/javascript" src="assets/packages/flutter_inappwebview_web/assets/web/web_support.js" defer></script>
|
<script type="application/javascript" src="assets/packages/flutter_inappwebview_web/assets/web/web_support.js" defer></script>
|
||||||
|
<script type="application/javascript" src="assets/packages/flutter_charset_detector_web/assets/web/jschardet.min.js" defer></script>
|
||||||
<script src="splash/splash.js"></script>
|
<script src="splash/splash.js"></script>
|
||||||
<script src="worker_service/worker_service.js"></script>
|
<script src="worker_service/worker_service.js"></script>
|
||||||
<script src="i18n/translater.js"></script>
|
<script src="i18n/translater.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user