TF-1877 Fix error TextEditingController was used after being disposed on some screen
(cherry picked from commit 50e4c6ec55eea21a45a5a8dd31cd239245248df3)
This commit is contained in:
@@ -65,6 +65,13 @@ class AppPages {
|
||||
manage_account_dashboard.loadLibrary,
|
||||
() => manage_account_dashboard.ManageAccountDashBoardView()),
|
||||
binding: ManageAccountDashBoardBindings()),
|
||||
GetPage(
|
||||
name: AppRoutes.contact,
|
||||
opaque: false,
|
||||
page: () => DeferredWidget(
|
||||
contact_view.loadLibrary,
|
||||
() => contact_view.ContactView()),
|
||||
binding: ContactBindings()),
|
||||
unknownRoutePage,
|
||||
if (PlatformInfo.isMobile)
|
||||
...[
|
||||
@@ -89,13 +96,6 @@ class AppPages {
|
||||
mailbox_creator.loadLibrary,
|
||||
() => mailbox_creator.MailboxCreatorView()),
|
||||
binding: MailboxCreatorBindings()),
|
||||
GetPage(
|
||||
name: AppRoutes.contact,
|
||||
opaque: false,
|
||||
page: () => DeferredWidget(
|
||||
contact_view.loadLibrary,
|
||||
() => contact_view.ContactView()),
|
||||
binding: ContactBindings()),
|
||||
GetPage(
|
||||
name: AppRoutes.rulesFilterCreator,
|
||||
opaque: false,
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/destination_picker/presentation/destination_picker_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/destination_picker/presentation/destination_picker_view.dart';
|
||||
import 'package:tmail_ui_user/features/identity_creator/presentation/identity_creator_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/identity_creator/presentation/identity_creator_view.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_creator/presentation/mailbox_creator_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_creator/presentation/mailbox_creator_view.dart';
|
||||
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/rules_filter_creator_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/rules_filter_creator_view.dart';
|
||||
import 'package:tmail_ui_user/main/routes/app_routes.dart';
|
||||
|
||||
class DialogRouter {
|
||||
|
||||
static Future<dynamic> pushGeneralDialog({
|
||||
required String routeName,
|
||||
required Object? arguments
|
||||
}) {
|
||||
_bindingDI(routeName);
|
||||
|
||||
return Get.generalDialog(
|
||||
routeSettings: RouteSettings(arguments: arguments),
|
||||
pageBuilder: (_, __, ___) => _generateView(routeName: routeName, arguments: arguments)
|
||||
);
|
||||
}
|
||||
|
||||
static void _bindingDI(String routeName) {
|
||||
log('DialogRouter::_bindingDI():routeName: $routeName');
|
||||
switch(routeName) {
|
||||
case AppRoutes.mailboxCreator:
|
||||
MailboxCreatorBindings().dependencies();
|
||||
break;
|
||||
case AppRoutes.rulesFilterCreator:
|
||||
RulesFilterCreatorBindings().dependencies();
|
||||
break;
|
||||
case AppRoutes.identityCreator:
|
||||
IdentityCreatorBindings().dependencies();
|
||||
break;
|
||||
case AppRoutes.destinationPicker:
|
||||
DestinationPickerBindings().dependencies();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static Widget _generateView({required String routeName, required Object? arguments}) {
|
||||
log('DialogRouter::_generateView():routeName: $routeName | arguments: $arguments');
|
||||
switch(routeName) {
|
||||
case AppRoutes.mailboxCreator:
|
||||
return MailboxCreatorView();
|
||||
case AppRoutes.rulesFilterCreator:
|
||||
return RuleFilterCreatorView();
|
||||
case AppRoutes.identityCreator:
|
||||
return IdentityCreatorView();
|
||||
case AppRoutes.destinationPicker:
|
||||
return DestinationPickerView();
|
||||
default:
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user