Skip to content

Commit

Permalink
タブ設定、設定のインポートでフリーズするのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
4ster1sk committed Nov 9, 2024
1 parent 47cefb3 commit f4c907c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
3 changes: 1 addition & 2 deletions lib/repository/import_export_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ 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.replaceAll([const SplashRoute()]);
}

Future<void> export(BuildContext context, Account account) async {
Expand Down
10 changes: 2 additions & 8 deletions lib/view/settings_page/account_settings_page/account_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,8 @@ 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.replaceAll([const SplashRoute()]),
child: Text(S.of(context).quitAccountSettings),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ 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.replaceAll([const SplashRoute()]),
child: Text(S.of(context).apply),
),
),
Expand Down

0 comments on commit f4c907c

Please sign in to comment.