From 05071b7932b228456e4f2f9dccad29eccc80da70 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sat, 9 Nov 2024 23:42:32 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=96=E8=A8=AD=E5=AE=9A=E3=80=81?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=AE=E3=82=A4=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=A7=E3=83=95=E3=83=AA=E3=83=BC=E3=82=BA=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/repository/import_export_repository.dart | 6 ++++-- .../account_settings_page/account_list.dart | 12 ++++-------- .../tab_settings_page/tab_settings_list_page.dart | 8 ++++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/repository/import_export_repository.dart b/lib/repository/import_export_repository.dart index 9966b1765..6ef46dbd2 100644 --- a/lib/repository/import_export_repository.dart +++ b/lib/repository/import_export_repository.dart @@ -108,8 +108,10 @@ class ImportExportRepository extends ChangeNotifier { await SimpleMessageDialog.show(context, S.of(context).importCompleted); if (!context.mounted) return; - context.router.removeWhere((route) => true); - await context.router.push(const SplashRoute()); + await context.router.pushAndPopUntil( + const SplashRoute(), + predicate: (_) => false, + ); } Future export(BuildContext context, Account account) async { diff --git a/lib/view/settings_page/account_settings_page/account_list.dart b/lib/view/settings_page/account_settings_page/account_list.dart index a25e477f2..628ad9777 100644 --- a/lib/view/settings_page/account_settings_page/account_list.dart +++ b/lib/view/settings_page/account_settings_page/account_list.dart @@ -59,14 +59,10 @@ class AccountListPage extends ConsumerWidget { child: Padding( padding: const EdgeInsets.all(10), child: ElevatedButton( - onPressed: () async { - final newState = ref.refresh(accountsProvider); - print(newState); - final router = context.router..removeWhere((route) => true); - WidgetsBinding.instance.addPostFrameCallback((_) async { - await router.push(const SplashRoute()); - }); - }, + onPressed: () async => await context.router.pushAndPopUntil( + const SplashRoute(), + predicate: (_) => false, + ), child: Text(S.of(context).quitAccountSettings), ), ), diff --git a/lib/view/settings_page/tab_settings_page/tab_settings_list_page.dart b/lib/view/settings_page/tab_settings_page/tab_settings_list_page.dart index f5fc4ae52..850f3a1f3 100644 --- a/lib/view/settings_page/tab_settings_page/tab_settings_list_page.dart +++ b/lib/view/settings_page/tab_settings_page/tab_settings_list_page.dart @@ -78,10 +78,10 @@ class TabSettingsListPage extends ConsumerWidget { child: Padding( padding: const EdgeInsets.all(10), child: ElevatedButton( - onPressed: () async { - context.router.removeWhere((route) => true); - await context.router.push(const SplashRoute()); - }, + onPressed: () async => await context.router.pushAndPopUntil( + const SplashRoute(), + predicate: (_) => false, + ), child: Text(S.of(context).apply), ), ),