Add an option to start on scans screen instead of capture screen
This commit is contained in:
@@ -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()),
|
||||
|
Reference in New Issue
Block a user