TF-4301 Add "Create a new label" button in Label As menus and wire up tagging in email view
This commit is contained in:
@@ -37,6 +37,7 @@ import 'package:tmail_ui_user/features/login/data/local/oidc_configuration_cache
|
||||
import 'package:tmail_ui_user/features/login/data/local/token_oidc_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/data/local/mailbox_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/data/local/state_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_creator/domain/usecases/verify_name_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/data/local/local_sort_order_manager.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/data/local/language_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/data/local/preferences_setting_manager.dart';
|
||||
@@ -58,6 +59,7 @@ class LocalBindings extends Bindings {
|
||||
_bindingKeychainSharing();
|
||||
_bindingCaching();
|
||||
_bindingWorkerQueue();
|
||||
_bindingVerifyLogicInteractor();
|
||||
}
|
||||
|
||||
void _bindingCaching() {
|
||||
@@ -170,4 +172,8 @@ class LocalBindings extends Bindings {
|
||||
void _bindingKeychainSharing() {
|
||||
Get.put(KeychainSharingManager(Get.find<FlutterSecureStorage>()));
|
||||
}
|
||||
|
||||
void _bindingVerifyLogicInteractor() {
|
||||
Get.put(VerifyNameInteractor());
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ class DialogRouter {
|
||||
required Object? arguments
|
||||
}) async {
|
||||
if (PlatformInfo.isWeb) {
|
||||
_isDialogOpened.value = true;
|
||||
_isMapDialogOpened[routeName] = true;
|
||||
}
|
||||
_bindingDI(routeName);
|
||||
|
||||
@@ -40,18 +40,15 @@ class DialogRouter {
|
||||
);
|
||||
|
||||
if (PlatformInfo.isWeb) {
|
||||
_isDialogOpened.value = false;
|
||||
if (routeName == AppRoutes.rulesFilterCreator) {
|
||||
isRuleFilterDialogOpened.value = false;
|
||||
}
|
||||
_isMapDialogOpened.remove(routeName);
|
||||
}
|
||||
return returnedValue;
|
||||
}
|
||||
|
||||
final RxBool _isDialogOpened = false.obs;
|
||||
final RxBool isRuleFilterDialogOpened = false.obs;
|
||||
final RxMap<String, bool> _isMapDialogOpened = RxMap<String, bool>();
|
||||
|
||||
bool get isDialogOpened => _isDialogOpened.value;
|
||||
bool get isDialogOpened =>
|
||||
_isMapDialogOpened.values.any((isOpened) => isOpened == true);
|
||||
|
||||
void _bindingDI(String routeName) {
|
||||
log('DialogRouter::_bindingDI():routeName: $routeName');
|
||||
@@ -60,9 +57,6 @@ class DialogRouter {
|
||||
MailboxCreatorBindings().dependencies();
|
||||
break;
|
||||
case AppRoutes.rulesFilterCreator:
|
||||
if (PlatformInfo.isWeb) {
|
||||
isRuleFilterDialogOpened.value = true;
|
||||
}
|
||||
RulesFilterCreatorBindings().dependencies();
|
||||
break;
|
||||
case AppRoutes.identityCreator:
|
||||
@@ -99,22 +93,26 @@ class DialogRouter {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> openDialogModal({
|
||||
Future<dynamic> openDialogModal({
|
||||
required Widget child,
|
||||
String? dialogLabel,
|
||||
required String dialogLabel,
|
||||
}) async {
|
||||
if (PlatformInfo.isWeb) {
|
||||
_isDialogOpened.value = true;
|
||||
}
|
||||
|
||||
await Get.generalDialog(
|
||||
barrierDismissible: true,
|
||||
barrierLabel: dialogLabel ?? 'dialog-modal',
|
||||
pageBuilder: (_, __, ___) => child,
|
||||
).whenComplete(() {
|
||||
try {
|
||||
if (PlatformInfo.isWeb) {
|
||||
_isDialogOpened.value = false;
|
||||
_isMapDialogOpened[dialogLabel] = true;
|
||||
}
|
||||
});
|
||||
|
||||
return await Get.generalDialog(
|
||||
barrierDismissible: true,
|
||||
barrierLabel: dialogLabel,
|
||||
pageBuilder: (_, __, ___) => child,
|
||||
);
|
||||
} catch (e) {
|
||||
logWarning('DialogRouter::openDialogModal: Exception = $e');
|
||||
} finally {
|
||||
if (PlatformInfo.isWeb) {
|
||||
_isMapDialogOpened.remove(dialogLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user