Add settings screen
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
2025-07-01 22:22:16 +02:00
parent 29fec99b8f
commit 9b14a28d86
6 changed files with 92 additions and 15 deletions

View File

@ -56,12 +56,12 @@ class CurrentAuthState extends _$CurrentAuthState {
/// The possible authentication states of the app.
enum AuthState {
unknown(redirectPath: homePath, allowedPaths: [homePath]),
unknown(redirectPath: homePage, allowedPaths: [homePage]),
unauthenticated(
redirectPath: authPath,
allowedPaths: [authPath, settingsPath],
redirectPath: authPage,
allowedPaths: [authPage, settingsPage],
),
authenticated(redirectPath: homePath, allowedPaths: null);
authenticated(redirectPath: homePage, allowedPaths: null);
const AuthState({required this.redirectPath, required this.allowedPaths});

View File

@ -1,7 +1,8 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:moneymgr_mobile/routes/login/login_screens.dart';
import 'package:moneymgr_mobile/routes/login/login_screen.dart';
import 'package:moneymgr_mobile/routes/settings/settings_screen.dart';
import 'package:moneymgr_mobile/services/auth_state.dart';
import 'package:moneymgr_mobile/services/router/routes_list.dart';
import 'package:moneymgr_mobile/widgets/scaffold_with_navigation.dart';
@ -58,11 +59,11 @@ GoRouter router(Ref ref) {
debugLogDiagnostics: true,
initialLocation: navigationItems.first.path,
routes: [
GoRoute(path: homePath, builder: (_, __) => const Scaffold()),
GoRoute(path: authPath, builder: (_, __) => const LoginScreen()),
GoRoute(path: homePage, builder: (_, __) => const Scaffold()),
GoRoute(path: authPage, builder: (_, __) => const LoginScreen()),
GoRoute(
path: settingsPath,
builder: (_, __) => const Text("settings screen"),
path: settingsPage,
builder: (_, __) => const SettingsScreen(),
),
// Configuration for the bottom navigation bar routes. The routes themselves

View File

@ -1,7 +1,7 @@
const homePath = "/";
const homePage = "/";
/// Authentication path
const authPath = "/login";
const authPage = "/login";
/// Settings path
const settingsPath = "/settings";
const settingsPage = "/settings";