TF-4136 Apply early exit to prevent string operation in log
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:core/utils/build_utils.dart';
|
import 'package:core/utils/build_utils.dart';
|
||||||
import 'package:core/utils/platform_info.dart';
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:core/utils/sentry/sentry_manager.dart';
|
import 'package:core/utils/sentry/sentry_manager.dart';
|
||||||
@@ -59,26 +61,33 @@ void _internalLog(
|
|||||||
? PlatformInfo.isWeb
|
? PlatformInfo.isWeb
|
||||||
: BuildUtils.isDebugMode;
|
: BuildUtils.isDebugMode;
|
||||||
|
|
||||||
if (!shouldPrint) {
|
final shouldSentry = _shouldReportToSentry(level);
|
||||||
|
|
||||||
|
if (!shouldPrint && !shouldSentry) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final rawMessage = _buildRawMessage(message, exception, extras, stackTrace);
|
final rawMessage = _buildRawMessage(message, exception, extras, stackTrace);
|
||||||
final formattedMessage = _formatMessage(level, rawMessage);
|
|
||||||
|
|
||||||
if (webConsoleEnabled && PlatformInfo.isWeb) {
|
if (shouldPrint) {
|
||||||
_printWebConsole(level, formattedMessage);
|
final formattedMessage = _formatMessage(level, rawMessage);
|
||||||
} else {
|
|
||||||
// ignore: avoid_print
|
if (webConsoleEnabled && PlatformInfo.isWeb) {
|
||||||
print('$appLogName $formattedMessage');
|
_printWebConsole(level, formattedMessage);
|
||||||
|
} else {
|
||||||
|
// ignore: avoid_print
|
||||||
|
print('$appLogName $formattedMessage');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_shouldReportToSentry(level)) {
|
if (shouldSentry) {
|
||||||
SentryManager.instance.captureException(
|
unawaited(
|
||||||
exception ?? rawMessage,
|
SentryManager.instance.captureException(
|
||||||
stackTrace: stackTrace,
|
exception ?? rawMessage,
|
||||||
message: rawMessage,
|
stackTrace: stackTrace,
|
||||||
extras: extras,
|
message: rawMessage,
|
||||||
|
extras: extras,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,71 +2,159 @@ import 'package:core/utils/app_logger.dart';
|
|||||||
import 'package:core/utils/platform_info.dart';
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:fk_user_agent/fk_user_agent.dart';
|
import 'package:fk_user_agent/fk_user_agent.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
|
||||||
class ApplicationManager {
|
class ApplicationManager {
|
||||||
|
ApplicationManager._internal();
|
||||||
|
|
||||||
static final ApplicationManager _instance = ApplicationManager._internal();
|
static final ApplicationManager _instance = ApplicationManager._internal();
|
||||||
|
|
||||||
factory ApplicationManager() => _instance;
|
factory ApplicationManager() => _instance;
|
||||||
|
|
||||||
ApplicationManager._internal();
|
|
||||||
|
|
||||||
// Allow overriding in unit tests
|
|
||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
static DeviceInfoPlugin? debugDeviceInfoOverride;
|
static DeviceInfoPlugin? debugDeviceInfoOverride;
|
||||||
|
|
||||||
DeviceInfoPlugin get _deviceInfoPlugin =>
|
DeviceInfoPlugin get _deviceInfo =>
|
||||||
debugDeviceInfoOverride ?? DeviceInfoPlugin();
|
debugDeviceInfoOverride ?? DeviceInfoPlugin();
|
||||||
|
|
||||||
Future<PackageInfo> getPackageInfo() async {
|
PackageInfo? _packageInfoCache;
|
||||||
final packageInfo = await PackageInfo.fromPlatform();
|
String? _versionCache;
|
||||||
log('ApplicationManager::getPackageInto: $packageInfo');
|
String? _cachedWebUserAgent;
|
||||||
return packageInfo;
|
String? _cachedMobileUserAgent;
|
||||||
|
bool _isMobileUserAgentInitialized = false;
|
||||||
|
|
||||||
|
@visibleForTesting
|
||||||
|
void clearCache() {
|
||||||
|
_packageInfoCache = null;
|
||||||
|
_versionCache = null;
|
||||||
|
_cachedWebUserAgent = null;
|
||||||
|
_cachedMobileUserAgent = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> getVersion() async {
|
Future<PackageInfo> getPackageInfo() async {
|
||||||
|
if (_packageInfoCache != null) {
|
||||||
|
return _packageInfoCache!;
|
||||||
|
}
|
||||||
|
|
||||||
|
final info = await PackageInfo.fromPlatform();
|
||||||
|
_packageInfoCache = info;
|
||||||
|
|
||||||
|
log('ApplicationManager:getPackageInfo -> cached: $info');
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> getAppVersion() async {
|
||||||
|
if (_versionCache != null) {
|
||||||
|
return _versionCache!;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final version = (await getPackageInfo()).version;
|
final version = (await getPackageInfo()).version;
|
||||||
log('ApplicationManager::getVersion: $version');
|
_versionCache = version;
|
||||||
|
|
||||||
|
log('ApplicationManager:getAppVersion -> cached: $version');
|
||||||
return version;
|
return version;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return '';
|
logWarning('ApplicationManager:getAppVersion failedd, Exception = $e');
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<String> getUserAgent() async {
|
|
||||||
try {
|
|
||||||
String userAgent = '';
|
|
||||||
if (PlatformInfo.isWeb) {
|
|
||||||
final webBrowserInfo = await _deviceInfoPlugin.webBrowserInfo;
|
|
||||||
userAgent = webBrowserInfo.userAgent ?? '';
|
|
||||||
} else if (PlatformInfo.isMobile) {
|
|
||||||
userAgent = FkUserAgent.userAgent ?? '';
|
|
||||||
}
|
|
||||||
log('ApplicationManager::getUserAgent: $userAgent');
|
|
||||||
return userAgent;
|
|
||||||
} catch(e) {
|
|
||||||
logWarning('ApplicationManager::getUserAgent: Exception: $e');
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initUserAgent() async {
|
Future<void> initUserAgent() async {
|
||||||
if (PlatformInfo.isMobile) {
|
if (!PlatformInfo.isMobile) return;
|
||||||
|
|
||||||
|
try {
|
||||||
await FkUserAgent.init();
|
await FkUserAgent.init();
|
||||||
|
_isMobileUserAgentInitialized = true;
|
||||||
|
_cachedMobileUserAgent = null;
|
||||||
|
|
||||||
|
log('ApplicationManager:initUserAgent -> initialized');
|
||||||
|
} catch (e) {
|
||||||
|
logWarning('ApplicationManager:initUserAgent failed, Exception $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> releaseUserAgent() async {
|
Future<void> releaseUserAgent() async {
|
||||||
if (PlatformInfo.isMobile) {
|
if (!PlatformInfo.isMobile) return;
|
||||||
|
|
||||||
|
try {
|
||||||
FkUserAgent.release();
|
FkUserAgent.release();
|
||||||
|
_isMobileUserAgentInitialized = false;
|
||||||
|
_cachedMobileUserAgent = null;
|
||||||
|
|
||||||
|
log('ApplicationManager:releaseUserAgent -> released & cache cleared');
|
||||||
|
} catch (e) {
|
||||||
|
logWarning('ApplicationManager:releaseUserAgent failed, Exception $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> generateApplicationUserAgent() async {
|
Future<String> getUserAgent() async {
|
||||||
final userAgent = await getUserAgent();
|
try {
|
||||||
final version = await getVersion();
|
if (PlatformInfo.isWeb) {
|
||||||
return 'Twake-Mail/$version $userAgent';
|
return _getWebUserAgent();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PlatformInfo.isMobile) {
|
||||||
|
return _getMobileUserAgent();
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
} catch (e) {
|
||||||
|
logWarning('ApplicationManager:getUserAgent failed');
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Future<String> _getWebUserAgent() async {
|
||||||
|
if (_cachedWebUserAgent != null) {
|
||||||
|
return _cachedWebUserAgent!;
|
||||||
|
}
|
||||||
|
|
||||||
|
WebBrowserInfo webInfo;
|
||||||
|
|
||||||
|
try {
|
||||||
|
webInfo = await _deviceInfo.webBrowserInfo;
|
||||||
|
} catch (e) {
|
||||||
|
logWarning('ApplicationManager:_getWebUserAgent failed, Exception $e');
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
final userAgent = webInfo.userAgent ?? '';
|
||||||
|
_cachedWebUserAgent = userAgent;
|
||||||
|
|
||||||
|
log('ApplicationManager:_getWebUserAgent -> cached');
|
||||||
|
return userAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> _getMobileUserAgent() async {
|
||||||
|
if (!_isMobileUserAgentInitialized) {
|
||||||
|
logWarning(
|
||||||
|
'ApplicationManager:_getMobileUserAgent called before initUserAgent',
|
||||||
|
);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_cachedMobileUserAgent != null) {
|
||||||
|
return _cachedMobileUserAgent!;
|
||||||
|
}
|
||||||
|
|
||||||
|
final userAgent = FkUserAgent.userAgent;
|
||||||
|
|
||||||
|
if (userAgent == null || userAgent.isEmpty) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
_cachedMobileUserAgent = userAgent;
|
||||||
|
log('ApplicationManager:_getMobileUserAgent -> cached');
|
||||||
|
|
||||||
|
return userAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> generateApplicationUserAgent() async {
|
||||||
|
final version = await getAppVersion();
|
||||||
|
final userAgent = await getUserAgent();
|
||||||
|
|
||||||
|
return 'Twake-Mail/$version $userAgent'.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class SentryConfig {
|
|||||||
throw Exception('Sentry configuration is missing');
|
throw Exception('Sentry configuration is missing');
|
||||||
}
|
}
|
||||||
|
|
||||||
final appVersion = await ApplicationManager().getVersion();
|
final appVersion = await ApplicationManager().getAppVersion();
|
||||||
|
|
||||||
return SentryConfig(
|
return SentryConfig(
|
||||||
dsn: sentryDSN,
|
dsn: sentryDSN,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ void main() {
|
|||||||
ApplicationManager.debugDeviceInfoOverride = mockDeviceInfoPlugin;
|
ApplicationManager.debugDeviceInfoOverride = mockDeviceInfoPlugin;
|
||||||
|
|
||||||
applicationManager = ApplicationManager();
|
applicationManager = ApplicationManager();
|
||||||
|
applicationManager.clearCache();
|
||||||
});
|
});
|
||||||
|
|
||||||
tearDown(() {
|
tearDown(() {
|
||||||
@@ -38,97 +39,170 @@ void main() {
|
|||||||
FkUserAgent.release();
|
FkUserAgent.release();
|
||||||
});
|
});
|
||||||
|
|
||||||
group('ApplicationManager::getUserAgent test', () {
|
group('ApplicationManager::getUserAgent', () {
|
||||||
test(
|
test(
|
||||||
'WHEN platform is Web THEN getUserAgent should return user agent for web',
|
'WHEN platform is Web THEN return web userAgent AND cache it',
|
||||||
() async {
|
() async {
|
||||||
const webUserAgent = 'User-Agent-Twake-Mail-Web';
|
const webUserAgent = 'User-Agent-Twake-Mail-Web';
|
||||||
|
|
||||||
PlatformInfo.isTestingForWeb = true;
|
PlatformInfo.isTestingForWeb = true;
|
||||||
|
|
||||||
when(mockDeviceInfoPlugin.webBrowserInfo).thenAnswer(
|
when(mockDeviceInfoPlugin.webBrowserInfo).thenAnswer(
|
||||||
(_) async => WebBrowserInfo(
|
(_) async => WebBrowserInfo(
|
||||||
userAgent: webUserAgent,
|
userAgent: webUserAgent,
|
||||||
appCodeName: '',
|
appCodeName: '',
|
||||||
appName: '',
|
appName: '',
|
||||||
appVersion: '',
|
appVersion: '',
|
||||||
deviceMemory: null,
|
deviceMemory: null,
|
||||||
language: '',
|
language: '',
|
||||||
languages: [],
|
languages: const [],
|
||||||
platform: '',
|
platform: '',
|
||||||
product: '',
|
product: '',
|
||||||
productSub: '',
|
productSub: '',
|
||||||
vendor: '',
|
vendor: '',
|
||||||
vendorSub: '',
|
vendorSub: '',
|
||||||
maxTouchPoints: null,
|
maxTouchPoints: null,
|
||||||
hardwareConcurrency: null,
|
hardwareConcurrency: null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final userAgent = await applicationManager.getUserAgent();
|
final firstCall = await applicationManager.getUserAgent();
|
||||||
|
final secondCall = await applicationManager.getUserAgent();
|
||||||
|
|
||||||
expect(userAgent, webUserAgent);
|
expect(firstCall, webUserAgent);
|
||||||
});
|
expect(secondCall, webUserAgent);
|
||||||
|
|
||||||
|
// platform channel must be called only once (cached)
|
||||||
|
verify(mockDeviceInfoPlugin.webBrowserInfo).called(1);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test(
|
test(
|
||||||
'WHEN platform is Android THEN getUserAgent should return user agent for Android',
|
'WHEN platform is Android THEN return mobile userAgent AND cache it',
|
||||||
() async {
|
() async {
|
||||||
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
||||||
|
|
||||||
const androidUserAgent = 'User-Agent-Twake-Mail-Android';
|
const androidUserAgent = 'User-Agent-Twake-Mail-Android';
|
||||||
|
|
||||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||||
.setMockMethodCallHandler(
|
.setMockMethodCallHandler(
|
||||||
const MethodChannel('fk_user_agent'),
|
const MethodChannel('fk_user_agent'),
|
||||||
(message) async {
|
(message) async {
|
||||||
if (message.method == 'getProperties') {
|
if (message.method == 'getProperties') {
|
||||||
return {'userAgent': androidUserAgent};
|
return {'userAgent': androidUserAgent};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
await FkUserAgent.init();
|
await applicationManager.initUserAgent();
|
||||||
|
|
||||||
final userAgent = await applicationManager.getUserAgent();
|
final firstCall = await applicationManager.getUserAgent();
|
||||||
|
final secondCall = await applicationManager.getUserAgent();
|
||||||
|
|
||||||
expect(userAgent, androidUserAgent);
|
expect(firstCall, androidUserAgent);
|
||||||
});
|
expect(secondCall, androidUserAgent);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test(
|
test(
|
||||||
'WHEN platform is Web AND mockDeviceInfoPlugin.webBrowserInfo throws exception THEN return empty string',
|
'WHEN platform is Web AND webBrowserInfo throws exception THEN return empty string',
|
||||||
() async {
|
() async {
|
||||||
PlatformInfo.isTestingForWeb = true;
|
PlatformInfo.isTestingForWeb = true;
|
||||||
|
|
||||||
when(mockDeviceInfoPlugin.webBrowserInfo)
|
when(mockDeviceInfoPlugin.webBrowserInfo).thenAnswer(
|
||||||
.thenThrow(Exception('Failed to get web browser info'));
|
(_) => Future<WebBrowserInfo>.error(
|
||||||
|
Exception('Failed to get web browser info'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
final userAgent = await applicationManager.getUserAgent();
|
final userAgent = await applicationManager.getUserAgent();
|
||||||
|
|
||||||
expect(userAgent, '');
|
expect(userAgent, '');
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test(
|
test(
|
||||||
'WHEN platform is Android AND FkUserAgent.userAgent empty THEN return empty string',
|
'WHEN platform is Android AND FkUserAgent returns empty THEN return empty string',
|
||||||
() async {
|
() async {
|
||||||
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
||||||
|
|
||||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||||
.setMockMethodCallHandler(
|
.setMockMethodCallHandler(
|
||||||
const MethodChannel('fk_user_agent'),
|
const MethodChannel('fk_user_agent'),
|
||||||
(message) async {
|
(message) async {
|
||||||
if (message.method == 'getProperties') {
|
if (message.method == 'getProperties') {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
await FkUserAgent.init();
|
await applicationManager.initUserAgent();
|
||||||
|
|
||||||
final userAgent = await applicationManager.getUserAgent();
|
final userAgent = await applicationManager.getUserAgent();
|
||||||
|
|
||||||
expect(userAgent, '');
|
expect(userAgent, '');
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
test(
|
||||||
|
'WHEN mobile userAgent is released THEN getUserAgent returns empty string',
|
||||||
|
() async {
|
||||||
|
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
||||||
|
|
||||||
|
const androidUserAgent = 'User-Agent-Twake-Mail-Android';
|
||||||
|
|
||||||
|
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||||
|
.setMockMethodCallHandler(
|
||||||
|
const MethodChannel('fk_user_agent'),
|
||||||
|
(message) async {
|
||||||
|
if (message.method == 'getProperties') {
|
||||||
|
return {'userAgent': androidUserAgent};
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
await applicationManager.initUserAgent();
|
||||||
|
|
||||||
|
final firstCall = await applicationManager.getUserAgent();
|
||||||
|
await applicationManager.releaseUserAgent();
|
||||||
|
final secondCall = await applicationManager.getUserAgent();
|
||||||
|
|
||||||
|
expect(firstCall, androidUserAgent);
|
||||||
|
expect(secondCall, '');
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
test(
|
||||||
|
'WHEN mobile userAgent is released AND re-initialized THEN cache rebuilt',
|
||||||
|
() async {
|
||||||
|
debugDefaultTargetPlatformOverride = TargetPlatform.android;
|
||||||
|
|
||||||
|
const androidUserAgent = 'User-Agent-Twake-Mail-Android';
|
||||||
|
|
||||||
|
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||||
|
.setMockMethodCallHandler(
|
||||||
|
const MethodChannel('fk_user_agent'),
|
||||||
|
(message) async {
|
||||||
|
if (message.method == 'getProperties') {
|
||||||
|
return {'userAgent': androidUserAgent};
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
await applicationManager.initUserAgent();
|
||||||
|
final firstCall = await applicationManager.getUserAgent();
|
||||||
|
|
||||||
|
await applicationManager.releaseUserAgent();
|
||||||
|
await applicationManager.initUserAgent();
|
||||||
|
final secondCall = await applicationManager.getUserAgent();
|
||||||
|
|
||||||
|
expect(firstCall, androidUserAgent);
|
||||||
|
expect(secondCall, androidUserAgent);
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
import 'package:core/utils/application_manager.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
|
|
||||||
class ApplicationVersionWidget extends StatefulWidget {
|
class ApplicationVersionWidget extends StatefulWidget {
|
||||||
|
|
||||||
@@ -22,13 +21,12 @@ class ApplicationVersionWidget extends StatefulWidget {
|
|||||||
|
|
||||||
class _ApplicationVersionWidgetState extends State<ApplicationVersionWidget> {
|
class _ApplicationVersionWidgetState extends State<ApplicationVersionWidget> {
|
||||||
|
|
||||||
final ApplicationManager _applicationManager = Get.find<ApplicationManager>();
|
|
||||||
Future<String>? _versionStream;
|
Future<String>? _versionStream;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_versionStream = _applicationManager.getVersion();
|
_versionStream = ApplicationManager().getAppVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -24,14 +24,12 @@ class ComposerRepositoryImpl extends ComposerRepository {
|
|||||||
final AttachmentUploadDataSource _attachmentUploadDataSource;
|
final AttachmentUploadDataSource _attachmentUploadDataSource;
|
||||||
final ComposerDataSource _composerDataSource;
|
final ComposerDataSource _composerDataSource;
|
||||||
final HtmlDataSource _htmlDataSource;
|
final HtmlDataSource _htmlDataSource;
|
||||||
final ApplicationManager _applicationManager;
|
|
||||||
final Uuid _uuid;
|
final Uuid _uuid;
|
||||||
|
|
||||||
ComposerRepositoryImpl(
|
ComposerRepositoryImpl(
|
||||||
this._attachmentUploadDataSource,
|
this._attachmentUploadDataSource,
|
||||||
this._composerDataSource,
|
this._composerDataSource,
|
||||||
this._htmlDataSource,
|
this._htmlDataSource,
|
||||||
this._applicationManager,
|
|
||||||
this._uuid,
|
this._uuid,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -74,7 +72,7 @@ class ComposerRepositoryImpl extends ComposerRepository {
|
|||||||
|
|
||||||
emailContent = HtmlUtils.wrapPlainTextLinks(emailContent);
|
emailContent = HtmlUtils.wrapPlainTextLinks(emailContent);
|
||||||
|
|
||||||
final userAgent = await _applicationManager.generateApplicationUserAgent();
|
final userAgent = await ApplicationManager().generateApplicationUserAgent();
|
||||||
final emailBodyPartId = PartId(_uuid.v1());
|
final emailBodyPartId = PartId(_uuid.v1());
|
||||||
|
|
||||||
final emailObject = createEmailRequest.generateEmail(
|
final emailObject = createEmailRequest.generateEmail(
|
||||||
|
|||||||
@@ -196,7 +196,6 @@ class ComposerBindings extends BaseBindings {
|
|||||||
Get.find<AttachmentUploadDataSource>(tag: composerId),
|
Get.find<AttachmentUploadDataSource>(tag: composerId),
|
||||||
Get.find<ComposerDataSource>(tag: composerId),
|
Get.find<ComposerDataSource>(tag: composerId),
|
||||||
Get.find<HtmlDataSource>(tag: composerId),
|
Get.find<HtmlDataSource>(tag: composerId),
|
||||||
Get.find<ApplicationManager>(),
|
|
||||||
Get.find<Uuid>(),
|
Get.find<Uuid>(),
|
||||||
), tag: composerId);
|
), tag: composerId);
|
||||||
Get.lazyPut(
|
Get.lazyPut(
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
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: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';
|
||||||
@@ -11,12 +10,12 @@ import 'package:tmail_ui_user/features/composer/domain/usecases/upload_attachmen
|
|||||||
import 'package:tmail_ui_user/features/email/data/datasource/html_datasource.dart';
|
import 'package:tmail_ui_user/features/email/data/datasource/html_datasource.dart';
|
||||||
import 'package:tmail_ui_user/features/email/data/datasource_impl/html_datasource_impl.dart';
|
import 'package:tmail_ui_user/features/email/data/datasource_impl/html_datasource_impl.dart';
|
||||||
import 'package:tmail_ui_user/features/email/data/local/html_analyzer.dart';
|
import 'package:tmail_ui_user/features/email/data/local/html_analyzer.dart';
|
||||||
import 'package:tmail_ui_user/features/public_asset/domain/usecase/create_public_asset_interactor.dart';
|
|
||||||
import 'package:tmail_ui_user/features/public_asset/data/datasource/public_asset_datasource.dart';
|
import 'package:tmail_ui_user/features/public_asset/data/datasource/public_asset_datasource.dart';
|
||||||
import 'package:tmail_ui_user/features/public_asset/data/datasource_impl/remote_public_asset_datasource_impl.dart';
|
import 'package:tmail_ui_user/features/public_asset/data/datasource_impl/remote_public_asset_datasource_impl.dart';
|
||||||
import 'package:tmail_ui_user/features/public_asset/data/network/public_asset_api.dart';
|
import 'package:tmail_ui_user/features/public_asset/data/network/public_asset_api.dart';
|
||||||
import 'package:tmail_ui_user/features/public_asset/data/repository/public_asset_repository_impl.dart';
|
import 'package:tmail_ui_user/features/public_asset/data/repository/public_asset_repository_impl.dart';
|
||||||
import 'package:tmail_ui_user/features/public_asset/domain/repository/public_asset_repository.dart';
|
import 'package:tmail_ui_user/features/public_asset/domain/repository/public_asset_repository.dart';
|
||||||
|
import 'package:tmail_ui_user/features/public_asset/domain/usecase/create_public_asset_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/public_asset/domain/usecase/delete_public_assets_interactor.dart';
|
import 'package:tmail_ui_user/features/public_asset/domain/usecase/delete_public_assets_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/public_asset/presentation/model/public_asset_arguments.dart';
|
import 'package:tmail_ui_user/features/public_asset/presentation/model/public_asset_arguments.dart';
|
||||||
import 'package:tmail_ui_user/features/public_asset/presentation/public_asset_controller.dart';
|
import 'package:tmail_ui_user/features/public_asset/presentation/public_asset_controller.dart';
|
||||||
@@ -124,7 +123,6 @@ class PublicAssetBindings extends BaseBindings {
|
|||||||
Get.find<AttachmentUploadDataSource>(tag: BindingTag.publicAssetBindingsTag),
|
Get.find<AttachmentUploadDataSource>(tag: BindingTag.publicAssetBindingsTag),
|
||||||
Get.find<ComposerDataSource>(tag: BindingTag.publicAssetBindingsTag),
|
Get.find<ComposerDataSource>(tag: BindingTag.publicAssetBindingsTag),
|
||||||
Get.find<HtmlDataSource>(tag: BindingTag.publicAssetBindingsTag),
|
Get.find<HtmlDataSource>(tag: BindingTag.publicAssetBindingsTag),
|
||||||
Get.find<ApplicationManager>(),
|
|
||||||
Get.find<Uuid>()),
|
Get.find<Uuid>()),
|
||||||
tag: BindingTag.publicAssetBindingsTag);
|
tag: BindingTag.publicAssetBindingsTag);
|
||||||
Get.lazyPut(
|
Get.lazyPut(
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class AIDataSourceImpl implements AIDataSource {
|
|||||||
try {
|
try {
|
||||||
final apiResponse = await _aiApi.generateMessage(prompt);
|
final apiResponse = await _aiApi.generateMessage(prompt);
|
||||||
return AIResponse(result: apiResponse.content);
|
return AIResponse(result: apiResponse.content);
|
||||||
} on DioError catch (e) {
|
} on DioException catch (e) {
|
||||||
throw Exception('Failed to generate AI text: ${e.message}');
|
throw Exception('Failed to generate AI text: ${e.message}');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw Exception('Failed to generate AI text: $e');
|
throw Exception('Failed to generate AI text: $e');
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'package:core/presentation/resources/image_paths.dart';
|
|||||||
import 'package:core/presentation/state/failure.dart';
|
import 'package:core/presentation/state/failure.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:jmap_dart_client/jmap/core/account/account.dart';
|
import 'package:jmap_dart_client/jmap/core/account/account.dart';
|
||||||
@@ -69,7 +68,6 @@ class SomeOtherException extends RemoteException {}
|
|||||||
MockSpec<ImagePaths>(),
|
MockSpec<ImagePaths>(),
|
||||||
MockSpec<ResponsiveUtils>(),
|
MockSpec<ResponsiveUtils>(),
|
||||||
MockSpec<Uuid>(),
|
MockSpec<Uuid>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
])
|
])
|
||||||
@@ -88,7 +86,6 @@ void main() {
|
|||||||
late MockImagePaths mockImagePaths;
|
late MockImagePaths mockImagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -104,7 +101,6 @@ void main() {
|
|||||||
mockImagePaths = MockImagePaths();
|
mockImagePaths = MockImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -123,7 +119,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(mockImagePaths);
|
Get.put<ImagePaths>(mockImagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
Get.testMode = true;
|
Get.testMode = true;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:dartz/dartz.dart';
|
import 'package:dartz/dartz.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:http_parser/http_parser.dart';
|
import 'package:http_parser/http_parser.dart';
|
||||||
@@ -8,9 +7,9 @@ import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
|||||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||||
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
||||||
import 'package:model/email/attachment.dart';
|
|
||||||
import 'package:mockito/annotations.dart';
|
import 'package:mockito/annotations.dart';
|
||||||
import 'package:mockito/mockito.dart';
|
import 'package:mockito/mockito.dart';
|
||||||
|
import 'package:model/email/attachment.dart';
|
||||||
import 'package:model/email/email_action_type.dart';
|
import 'package:model/email/email_action_type.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/repository/composer_repository_impl.dart';
|
import 'package:tmail_ui_user/features/composer/data/repository/composer_repository_impl.dart';
|
||||||
@@ -25,7 +24,6 @@ import 'composer_repository_impl_test.mocks.dart';
|
|||||||
AttachmentUploadDataSource,
|
AttachmentUploadDataSource,
|
||||||
ComposerDataSource,
|
ComposerDataSource,
|
||||||
HtmlDataSource,
|
HtmlDataSource,
|
||||||
ApplicationManager,
|
|
||||||
Uuid,
|
Uuid,
|
||||||
CreateEmailRequest,
|
CreateEmailRequest,
|
||||||
Session,
|
Session,
|
||||||
@@ -37,7 +35,6 @@ void main() {
|
|||||||
late MockAttachmentUploadDataSource mockAttachmentUploadDataSource;
|
late MockAttachmentUploadDataSource mockAttachmentUploadDataSource;
|
||||||
late MockComposerDataSource mockComposerDataSource;
|
late MockComposerDataSource mockComposerDataSource;
|
||||||
late MockHtmlDataSource mockHtmlDataSource;
|
late MockHtmlDataSource mockHtmlDataSource;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockCreateEmailRequest mockCreateEmailRequest;
|
late MockCreateEmailRequest mockCreateEmailRequest;
|
||||||
late MockSession mockSession;
|
late MockSession mockSession;
|
||||||
@@ -47,7 +44,6 @@ void main() {
|
|||||||
mockAttachmentUploadDataSource = MockAttachmentUploadDataSource();
|
mockAttachmentUploadDataSource = MockAttachmentUploadDataSource();
|
||||||
mockComposerDataSource = MockComposerDataSource();
|
mockComposerDataSource = MockComposerDataSource();
|
||||||
mockHtmlDataSource = MockHtmlDataSource();
|
mockHtmlDataSource = MockHtmlDataSource();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockCreateEmailRequest = MockCreateEmailRequest();
|
mockCreateEmailRequest = MockCreateEmailRequest();
|
||||||
mockSession = MockSession();
|
mockSession = MockSession();
|
||||||
@@ -67,7 +63,6 @@ void main() {
|
|||||||
mockAttachmentUploadDataSource,
|
mockAttachmentUploadDataSource,
|
||||||
mockComposerDataSource,
|
mockComposerDataSource,
|
||||||
mockHtmlDataSource,
|
mockHtmlDataSource,
|
||||||
mockApplicationManager,
|
|
||||||
mockUuid,
|
mockUuid,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -81,7 +76,6 @@ void main() {
|
|||||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==';
|
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==';
|
||||||
const emailContentWithBase64 = '<p>Hello <img src="$base64Image" alt="test image"></p>';
|
const emailContentWithBase64 = '<p>Hello <img src="$base64Image" alt="test image"></p>';
|
||||||
const emailContentWithCid = '<p>Hello <img src="cid:unique-cid" alt="test image"></p>';
|
const emailContentWithCid = '<p>Hello <img src="cid:unique-cid" alt="test image"></p>';
|
||||||
const userAgent = 'TestUserAgent';
|
|
||||||
const partIdValue = 'part-id-123';
|
const partIdValue = 'part-id-123';
|
||||||
final inlineAttachments = {
|
final inlineAttachments = {
|
||||||
'unique-cid': Attachment(name: 'test.png'),
|
'unique-cid': Attachment(name: 'test.png'),
|
||||||
@@ -115,9 +109,6 @@ void main() {
|
|||||||
when(mockHtmlDataSource.removeCollapsedExpandedSignatureEffect(emailContent: emailContentWithCid))
|
when(mockHtmlDataSource.removeCollapsedExpandedSignatureEffect(emailContent: emailContentWithCid))
|
||||||
.thenAnswer((_) async => emailContentWithCid);
|
.thenAnswer((_) async => emailContentWithCid);
|
||||||
|
|
||||||
when(mockApplicationManager.generateApplicationUserAgent())
|
|
||||||
.thenAnswer((_) async => userAgent);
|
|
||||||
|
|
||||||
when(mockUuid.v1()).thenReturn(partIdValue);
|
when(mockUuid.v1()).thenReturn(partIdValue);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
@@ -142,7 +133,6 @@ void main() {
|
|||||||
() async {
|
() async {
|
||||||
// Arrange
|
// Arrange
|
||||||
const emailContentWithBase64 = '<p>Hello <img src="data:image/png;base64,abc123" alt="test"></p>';
|
const emailContentWithBase64 = '<p>Hello <img src="data:image/png;base64,abc123" alt="test"></p>';
|
||||||
const userAgent = 'TestUserAgent';
|
|
||||||
const partIdValue = 'part-id-123';
|
const partIdValue = 'part-id-123';
|
||||||
final inlineAttachments = {
|
final inlineAttachments = {
|
||||||
'cid-1': Attachment(name: 'test.png'),
|
'cid-1': Attachment(name: 'test.png'),
|
||||||
@@ -173,9 +163,6 @@ void main() {
|
|||||||
when(mockHtmlDataSource.removeCollapsedExpandedSignatureEffect(emailContent: emailContentWithBase64))
|
when(mockHtmlDataSource.removeCollapsedExpandedSignatureEffect(emailContent: emailContentWithBase64))
|
||||||
.thenAnswer((_) async => emailContentWithBase64);
|
.thenAnswer((_) async => emailContentWithBase64);
|
||||||
|
|
||||||
when(mockApplicationManager.generateApplicationUserAgent())
|
|
||||||
.thenAnswer((_) async => userAgent);
|
|
||||||
|
|
||||||
when(mockUuid.v1()).thenReturn(partIdValue);
|
when(mockUuid.v1()).thenReturn(partIdValue);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
@@ -197,7 +184,6 @@ void main() {
|
|||||||
'generateEmail should process it correctly and return a valid email',
|
'generateEmail should process it correctly and return a valid email',
|
||||||
() async {
|
() async {
|
||||||
const plainEmailContent = '<p>Hello, this is a simple email</p>';
|
const plainEmailContent = '<p>Hello, this is a simple email</p>';
|
||||||
const userAgent = 'TestUserAgent';
|
|
||||||
const partIdValue = 'part-id-123';
|
const partIdValue = 'part-id-123';
|
||||||
final attachments = [Attachment(name: 'test.png')];
|
final attachments = [Attachment(name: 'test.png')];
|
||||||
final emailBodyParts = {
|
final emailBodyParts = {
|
||||||
@@ -228,9 +214,6 @@ void main() {
|
|||||||
when(mockHtmlDataSource.removeCollapsedExpandedSignatureEffect(emailContent: plainEmailContent))
|
when(mockHtmlDataSource.removeCollapsedExpandedSignatureEffect(emailContent: plainEmailContent))
|
||||||
.thenAnswer((_) async => plainEmailContent);
|
.thenAnswer((_) async => plainEmailContent);
|
||||||
|
|
||||||
when(mockApplicationManager.generateApplicationUserAgent())
|
|
||||||
.thenAnswer((_) async => userAgent);
|
|
||||||
|
|
||||||
when(mockUuid.v1()).thenReturn(partIdValue);
|
when(mockUuid.v1()).thenReturn(partIdValue);
|
||||||
|
|
||||||
final result = await repository.generateEmail(mockCreateEmailRequest);
|
final result = await repository.generateEmail(mockCreateEmailRequest);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:core/presentation/state/success.dart';
|
|||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
import 'package:core/presentation/views/button/tmail_button_widget.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';
|
import 'package:dartz/dartz.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -167,7 +166,6 @@ class MockMailboxDashBoardController extends Mock implements MailboxDashBoardCon
|
|||||||
MockSpec<ImagePaths>(),
|
MockSpec<ImagePaths>(),
|
||||||
MockSpec<ResponsiveUtils>(),
|
MockSpec<ResponsiveUtils>(),
|
||||||
MockSpec<Uuid>(),
|
MockSpec<Uuid>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
|
|
||||||
@@ -211,7 +209,6 @@ void main() {
|
|||||||
late MockDeleteAuthorityOidcInteractor mockDeleteAuthorityOidcInteractor;
|
late MockDeleteAuthorityOidcInteractor mockDeleteAuthorityOidcInteractor;
|
||||||
late MockAppToast mockAppToast;
|
late MockAppToast mockAppToast;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -257,7 +254,6 @@ void main() {
|
|||||||
mockDeleteAuthorityOidcInteractor = MockDeleteAuthorityOidcInteractor();
|
mockDeleteAuthorityOidcInteractor = MockDeleteAuthorityOidcInteractor();
|
||||||
mockAppToast = MockAppToast();
|
mockAppToast = MockAppToast();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -276,7 +272,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(ImagePaths());
|
Get.put<ImagePaths>(ImagePaths());
|
||||||
Get.put<ResponsiveUtils>(ResponsiveUtils());
|
Get.put<ResponsiveUtils>(ResponsiveUtils());
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ const fallbackGenerators = {
|
|||||||
MockSpec<MaybeCalendarEventInteractor>(),
|
MockSpec<MaybeCalendarEventInteractor>(),
|
||||||
MockSpec<RejectCalendarEventInteractor>(),
|
MockSpec<RejectCalendarEventInteractor>(),
|
||||||
MockSpec<PrintUtils>(),
|
MockSpec<PrintUtils>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<CalendarEventDataSource>(),
|
MockSpec<CalendarEventDataSource>(),
|
||||||
MockSpec<DioClient>(),
|
MockSpec<DioClient>(),
|
||||||
@@ -123,7 +122,6 @@ void main() {
|
|||||||
final uuid = MockUuid();
|
final uuid = MockUuid();
|
||||||
final printEmailInteractor = MockPrintEmailInteractor();
|
final printEmailInteractor = MockPrintEmailInteractor();
|
||||||
final printUtils = MockPrintUtils();
|
final printUtils = MockPrintUtils();
|
||||||
final applicationManager = MockApplicationManager();
|
|
||||||
final mockToastManager = MockToastManager();
|
final mockToastManager = MockToastManager();
|
||||||
final mockTwakeAppManager = MockTwakeAppManager();
|
final mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -159,7 +157,6 @@ void main() {
|
|||||||
Get.put<ResponsiveUtils>(responsiveUtils);
|
Get.put<ResponsiveUtils>(responsiveUtils);
|
||||||
Get.put<Uuid>(uuid);
|
Get.put<Uuid>(uuid);
|
||||||
Get.put<PrintUtils>(printUtils);
|
Get.put<PrintUtils>(printUtils);
|
||||||
Get.put<ApplicationManager>(applicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:core/presentation/state/failure.dart';
|
|||||||
import 'package:core/presentation/state/success.dart';
|
import 'package:core/presentation/state/success.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:dartz/dartz.dart';
|
import 'package:dartz/dartz.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -62,7 +61,6 @@ import 'home_controller_test.mocks.dart';
|
|||||||
MockSpec<GetOidcUserInfoInteractor>(),
|
MockSpec<GetOidcUserInfoInteractor>(),
|
||||||
MockSpec<CachingManager>(),
|
MockSpec<CachingManager>(),
|
||||||
MockSpec<LanguageCacheManager>(),
|
MockSpec<LanguageCacheManager>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
])
|
])
|
||||||
@@ -95,7 +93,6 @@ void main() {
|
|||||||
late MockImagePaths mockImagePaths;
|
late MockImagePaths mockImagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -126,7 +123,6 @@ void main() {
|
|||||||
mockImagePaths = MockImagePaths();
|
mockImagePaths = MockImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -150,7 +146,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(mockImagePaths);
|
Get.put<ImagePaths>(mockImagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
Get.testMode = true;
|
Get.testMode = true;
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import 'package:core/data/network/download/download_client.dart';
|
|||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
import 'package:core/utils/file_utils.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';
|
||||||
@@ -69,7 +68,6 @@ import 'identity_creator_controller_test.mocks.dart';
|
|||||||
MockSpec<ImagePaths>(),
|
MockSpec<ImagePaths>(),
|
||||||
MockSpec<ResponsiveUtils>(),
|
MockSpec<ResponsiveUtils>(),
|
||||||
MockSpec<Uuid>(),
|
MockSpec<Uuid>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
// Identity creator controller mockspecs
|
// Identity creator controller mockspecs
|
||||||
@@ -115,7 +113,6 @@ void main() {
|
|||||||
late MockImagePaths mockImagePaths;
|
late MockImagePaths mockImagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -132,7 +129,6 @@ void main() {
|
|||||||
mockImagePaths = MockImagePaths();
|
mockImagePaths = MockImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -151,7 +147,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(mockImagePaths);
|
Get.put<ImagePaths>(mockImagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart';
|
|||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -82,7 +81,6 @@ import 'login_controller_test.mocks.dart';
|
|||||||
MockSpec<GetOidcUserInfoInteractor>(),
|
MockSpec<GetOidcUserInfoInteractor>(),
|
||||||
MockSpec<CachingManager>(),
|
MockSpec<CachingManager>(),
|
||||||
MockSpec<LanguageCacheManager>(),
|
MockSpec<LanguageCacheManager>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
])
|
])
|
||||||
@@ -117,7 +115,6 @@ void main() {
|
|||||||
late MockImagePaths mockImagePaths;
|
late MockImagePaths mockImagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -158,7 +155,6 @@ void main() {
|
|||||||
mockImagePaths = MockImagePaths();
|
mockImagePaths = MockImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -181,7 +177,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(mockImagePaths);
|
Get.put<ImagePaths>(mockImagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
Get.testMode = true;
|
Get.testMode = true;
|
||||||
|
|||||||
+1
-6
@@ -2,7 +2,6 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart';
|
|||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -12,6 +11,7 @@ import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
|||||||
import 'package:mockito/annotations.dart';
|
import 'package:mockito/annotations.dart';
|
||||||
import 'package:mockito/mockito.dart';
|
import 'package:mockito/mockito.dart';
|
||||||
import 'package:model/mailbox/presentation_mailbox.dart';
|
import 'package:model/mailbox/presentation_mailbox.dart';
|
||||||
|
import 'package:tmail_ui_user/features/base/model/filter_filter.dart';
|
||||||
import 'package:tmail_ui_user/features/caching/caching_manager.dart';
|
import 'package:tmail_ui_user/features/caching/caching_manager.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/login/data/network/interceptors/authorization_interceptors.dart';
|
import 'package:tmail_ui_user/features/login/data/network/interceptors/authorization_interceptors.dart';
|
||||||
@@ -24,7 +24,6 @@ import 'package:tmail_ui_user/features/mailbox_dashboard/domain/usecases/store_e
|
|||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/advanced_filter_controller.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/advanced_filter_controller.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/search_controller.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/search_controller.dart';
|
||||||
import 'package:tmail_ui_user/features/base/model/filter_filter.dart';
|
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/email_receive_time_type.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/email_receive_time_type.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/email_sort_order_type.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/email_sort_order_type.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/search_email_filter.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/search_email_filter.dart';
|
||||||
@@ -57,7 +56,6 @@ const fallbackGenerators = {
|
|||||||
MockSpec<ImagePaths>(),
|
MockSpec<ImagePaths>(),
|
||||||
MockSpec<ResponsiveUtils>(),
|
MockSpec<ResponsiveUtils>(),
|
||||||
MockSpec<Uuid>(),
|
MockSpec<Uuid>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
// Advanced filter controller mock specs
|
// Advanced filter controller mock specs
|
||||||
@@ -96,7 +94,6 @@ void main() {
|
|||||||
late MockImagePaths mockImagePaths;
|
late MockImagePaths mockImagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -114,7 +111,6 @@ void main() {
|
|||||||
mockImagePaths = MockImagePaths();
|
mockImagePaths = MockImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -133,7 +129,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(mockImagePaths);
|
Get.put<ImagePaths>(mockImagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
|
|
||||||
|
|||||||
-4
@@ -2,7 +2,6 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart';
|
|||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.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';
|
||||||
@@ -190,7 +189,6 @@ const fallbackGenerators = {
|
|||||||
MockSpec<LanguageCacheManager>(),
|
MockSpec<LanguageCacheManager>(),
|
||||||
MockSpec<RemoveAllComposerCacheOnWebInteractor>(),
|
MockSpec<RemoveAllComposerCacheOnWebInteractor>(),
|
||||||
MockSpec<RemoveComposerCacheByIdOnWebInteractor>(),
|
MockSpec<RemoveComposerCacheByIdOnWebInteractor>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
MockSpec<GetAllIdentitiesInteractor>(),
|
MockSpec<GetAllIdentitiesInteractor>(),
|
||||||
@@ -265,7 +263,6 @@ void main() {
|
|||||||
final imagePaths = MockImagePaths();
|
final imagePaths = MockImagePaths();
|
||||||
final responsiveUtils = MockResponsiveUtils();
|
final responsiveUtils = MockResponsiveUtils();
|
||||||
final uuid = MockUuid();
|
final uuid = MockUuid();
|
||||||
final applicationManager = MockApplicationManager();
|
|
||||||
final mockToastManager = MockToastManager();
|
final mockToastManager = MockToastManager();
|
||||||
final mockTwakeAppManager = MockTwakeAppManager();
|
final mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -341,7 +338,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(imagePaths);
|
Get.put<ImagePaths>(imagePaths);
|
||||||
Get.put<ResponsiveUtils>(responsiveUtils);
|
Get.put<ResponsiveUtils>(responsiveUtils);
|
||||||
Get.put<Uuid>(uuid);
|
Get.put<Uuid>(uuid);
|
||||||
Get.put<ApplicationManager>(applicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
Get.put<GetSessionInteractor>(getSessionInteractor);
|
Get.put<GetSessionInteractor>(getSessionInteractor);
|
||||||
|
|||||||
-4
@@ -2,7 +2,6 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart';
|
|||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:dartz/dartz.dart';
|
import 'package:dartz/dartz.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart' hide SearchController, State;
|
import 'package:flutter/material.dart' hide SearchController, State;
|
||||||
@@ -200,7 +199,6 @@ const fallbackGenerators = {
|
|||||||
MockSpec<LanguageCacheManager>(),
|
MockSpec<LanguageCacheManager>(),
|
||||||
MockSpec<RemoveAllComposerCacheOnWebInteractor>(),
|
MockSpec<RemoveAllComposerCacheOnWebInteractor>(),
|
||||||
MockSpec<RemoveComposerCacheByIdOnWebInteractor>(),
|
MockSpec<RemoveComposerCacheByIdOnWebInteractor>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<GetAllIdentitiesInteractor>(),
|
MockSpec<GetAllIdentitiesInteractor>(),
|
||||||
MockSpec<GetQuotasInteractor>(),
|
MockSpec<GetQuotasInteractor>(),
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
@@ -265,7 +263,6 @@ void main() {
|
|||||||
final imagePaths = ImagePaths();
|
final imagePaths = ImagePaths();
|
||||||
final responsiveUtils = MockResponsiveUtils();
|
final responsiveUtils = MockResponsiveUtils();
|
||||||
final uuid = MockUuid();
|
final uuid = MockUuid();
|
||||||
final applicationManager = MockApplicationManager();
|
|
||||||
|
|
||||||
final getSessionInteractor = MockGetSessionInteractor();
|
final getSessionInteractor = MockGetSessionInteractor();
|
||||||
final getAuthenticatedAccountInteractor = MockGetAuthenticatedAccountInteractor();
|
final getAuthenticatedAccountInteractor = MockGetAuthenticatedAccountInteractor();
|
||||||
@@ -349,7 +346,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(imagePaths);
|
Get.put<ImagePaths>(imagePaths);
|
||||||
Get.put<ResponsiveUtils>(responsiveUtils);
|
Get.put<ResponsiveUtils>(responsiveUtils);
|
||||||
Get.put<Uuid>(uuid);
|
Get.put<Uuid>(uuid);
|
||||||
Get.put<ApplicationManager>(applicationManager);
|
|
||||||
Get.put<GetSessionInteractor>(getSessionInteractor);
|
Get.put<GetSessionInteractor>(getSessionInteractor);
|
||||||
Get.put<GetAuthenticatedAccountInteractor>(getAuthenticatedAccountInteractor);
|
Get.put<GetAuthenticatedAccountInteractor>(getAuthenticatedAccountInteractor);
|
||||||
Get.put<UpdateAccountCacheInteractor>(updateAccountCacheInteractor);
|
Get.put<UpdateAccountCacheInteractor>(updateAccountCacheInteractor);
|
||||||
|
|||||||
-5
@@ -2,7 +2,6 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart';
|
|||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:dartz/dartz.dart';
|
import 'package:dartz/dartz.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -65,7 +64,6 @@ const fallbackGenerators = {
|
|||||||
MockSpec<ImagePaths>(),
|
MockSpec<ImagePaths>(),
|
||||||
MockSpec<ResponsiveUtils>(),
|
MockSpec<ResponsiveUtils>(),
|
||||||
MockSpec<Uuid>(),
|
MockSpec<Uuid>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
|
|
||||||
@@ -111,7 +109,6 @@ void main() {
|
|||||||
late MockImagePaths mockImagePaths;
|
late MockImagePaths mockImagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -130,7 +127,6 @@ void main() {
|
|||||||
mockImagePaths = MockImagePaths();
|
mockImagePaths = MockImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -151,7 +147,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(mockImagePaths);
|
Get.put<ImagePaths>(mockImagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
|
|
||||||
|
|||||||
-5
@@ -2,7 +2,6 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart';
|
|||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:dartz/dartz.dart' hide State;
|
import 'package:dartz/dartz.dart' hide State;
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart' hide State;
|
import 'package:flutter/material.dart' hide State;
|
||||||
@@ -66,7 +65,6 @@ import 'rule_filter_creator_controller_test.mocks.dart';
|
|||||||
MockSpec<AppToast>(),
|
MockSpec<AppToast>(),
|
||||||
MockSpec<ResponsiveUtils>(),
|
MockSpec<ResponsiveUtils>(),
|
||||||
MockSpec<Uuid>(),
|
MockSpec<Uuid>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
// Rule filter creator controller mock specs
|
// Rule filter creator controller mock specs
|
||||||
@@ -95,7 +93,6 @@ void main() {
|
|||||||
late ImagePaths imagePaths;
|
late ImagePaths imagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -114,7 +111,6 @@ void main() {
|
|||||||
imagePaths = ImagePaths();
|
imagePaths = ImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -133,7 +129,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(imagePaths);
|
Get.put<ImagePaths>(imagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'package:core/presentation/resources/image_paths.dart';
|
|||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/utils/app_logger.dart';
|
import 'package:core/utils/app_logger.dart';
|
||||||
import 'package:core/utils/application_manager.dart';
|
|
||||||
import 'package:dartz/dartz.dart' hide State;
|
import 'package:dartz/dartz.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';
|
||||||
@@ -115,7 +114,6 @@ const fallbackGenerators = {
|
|||||||
MockSpec<ImagePaths>(),
|
MockSpec<ImagePaths>(),
|
||||||
MockSpec<ResponsiveUtils>(),
|
MockSpec<ResponsiveUtils>(),
|
||||||
MockSpec<Uuid>(),
|
MockSpec<Uuid>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
// Thread controller mock specs
|
// Thread controller mock specs
|
||||||
@@ -251,7 +249,6 @@ void main() {
|
|||||||
late MockImagePaths mockImagePaths;
|
late MockImagePaths mockImagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -269,7 +266,6 @@ void main() {
|
|||||||
mockImagePaths = MockImagePaths();
|
mockImagePaths = MockImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -288,7 +284,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(mockImagePaths);
|
Get.put<ImagePaths>(mockImagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import 'package:core/presentation/resources/image_paths.dart';
|
|||||||
import 'package:core/presentation/state/success.dart';
|
import 'package:core/presentation/state/success.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.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:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
@@ -75,7 +74,6 @@ const fallbackGenerators = {
|
|||||||
MockSpec<ImagePaths>(),
|
MockSpec<ImagePaths>(),
|
||||||
MockSpec<ResponsiveUtils>(),
|
MockSpec<ResponsiveUtils>(),
|
||||||
MockSpec<Uuid>(),
|
MockSpec<Uuid>(),
|
||||||
MockSpec<ApplicationManager>(),
|
|
||||||
MockSpec<ToastManager>(),
|
MockSpec<ToastManager>(),
|
||||||
MockSpec<TwakeAppManager>(),
|
MockSpec<TwakeAppManager>(),
|
||||||
// Thread controller mock specs
|
// Thread controller mock specs
|
||||||
@@ -118,7 +116,6 @@ void main() {
|
|||||||
late MockImagePaths mockImagePaths;
|
late MockImagePaths mockImagePaths;
|
||||||
late MockResponsiveUtils mockResponsiveUtils;
|
late MockResponsiveUtils mockResponsiveUtils;
|
||||||
late MockUuid mockUuid;
|
late MockUuid mockUuid;
|
||||||
late MockApplicationManager mockApplicationManager;
|
|
||||||
late MockToastManager mockToastManager;
|
late MockToastManager mockToastManager;
|
||||||
late MockTwakeAppManager mockTwakeAppManager;
|
late MockTwakeAppManager mockTwakeAppManager;
|
||||||
|
|
||||||
@@ -136,7 +133,6 @@ void main() {
|
|||||||
mockImagePaths = MockImagePaths();
|
mockImagePaths = MockImagePaths();
|
||||||
mockResponsiveUtils = MockResponsiveUtils();
|
mockResponsiveUtils = MockResponsiveUtils();
|
||||||
mockUuid = MockUuid();
|
mockUuid = MockUuid();
|
||||||
mockApplicationManager = MockApplicationManager();
|
|
||||||
mockToastManager = MockToastManager();
|
mockToastManager = MockToastManager();
|
||||||
mockTwakeAppManager = MockTwakeAppManager();
|
mockTwakeAppManager = MockTwakeAppManager();
|
||||||
|
|
||||||
@@ -155,7 +151,6 @@ void main() {
|
|||||||
Get.put<ImagePaths>(mockImagePaths);
|
Get.put<ImagePaths>(mockImagePaths);
|
||||||
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
Get.put<ResponsiveUtils>(mockResponsiveUtils);
|
||||||
Get.put<Uuid>(mockUuid);
|
Get.put<Uuid>(mockUuid);
|
||||||
Get.put<ApplicationManager>(mockApplicationManager);
|
|
||||||
Get.put<ToastManager>(mockToastManager);
|
Get.put<ToastManager>(mockToastManager);
|
||||||
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
Get.put<TwakeAppManager>(mockTwakeAppManager);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user