Add an option to start on scans screen instead of capture screen
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-07-17 18:04:03 +02:00
parent 8db2cf3ece
commit 17a22d7a4c
3 changed files with 27 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import 'package:moneymgr_mobile/routes/scan_details/scan_details.dart';
import 'package:moneymgr_mobile/routes/scans_list/scans_list_screen.dart';
import 'package:moneymgr_mobile/routes/settings/settings_screen.dart';
import 'package:moneymgr_mobile/services/router/routes_list.dart';
import 'package:moneymgr_mobile/services/storage/prefs.dart';
import 'package:moneymgr_mobile/widgets/load_startup_data.dart';
import 'package:moneymgr_mobile/widgets/scaffold_with_navigation.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -29,6 +30,8 @@ GoRouter router(Ref ref) {
authStateNotifier.value = value;
});
final prefs = ref.read(prefsProvider).requireValue;
// This is the only place you need to define your navigation items. The items
// will be propagated automatically to the router and the navigation bar/rail
// of the scaffold.
@@ -70,7 +73,7 @@ GoRouter router(Ref ref) {
final router = GoRouter(
debugLogDiagnostics: true,
initialLocation: navigationItems.first.path,
initialLocation: prefs.startOnScansListScreen() ? scansPage : capturePage,
routes: [
GoRoute(path: homePage, builder: (_, __) => const Scaffold()),
GoRoute(path: authPage, builder: (_, __) => const LoginScreen()),