Add back navigation from login to setup screen

- Add back button on login page for first-time online mode setup
- Allow users to return to setup screen and change their mode selection
- Add backToSetup localization string for English and German
This commit is contained in:
m3mo 2026-02-03 18:27:24 +01:00
parent 28c2eed5d2
commit fbccd5b7d9
6 changed files with 30 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import '../../../../l10n/app_localizations.dart';
import '../../../settings/presentation/viewmodels/settings_viewmodel.dart';
import '../viewmodels/auth_viewmodel.dart';
class LoginPage extends StatefulWidget {
@ -178,6 +179,19 @@ class _LoginPageState extends State<LoginPage> {
),
],
),
const SizedBox(height: 16),
TextButton.icon(
onPressed: () async {
final settingsVm = context.read<SettingsViewModel>();
await settingsVm.setSetupCompleted(false);
await settingsVm.setOnboardingShown(false);
if (context.mounted) {
context.go('/setup');
}
},
icon: const Icon(Icons.arrow_back),
label: Text(l10n.backToSetup),
),
],
),
),

View File

@ -76,5 +76,6 @@
"switchModeWarning": "Der Moduswechsel ändert, wie Ihre Aufgaben gespeichert werden.",
"uploadTasksQuestion": "Möchten Sie Ihre lokalen Aufgaben auf den Server hochladen?",
"yes": "Ja",
"no": "Nein"
"no": "Nein",
"backToSetup": "Zurück zur Einrichtung"
}

View File

@ -76,5 +76,6 @@
"switchModeWarning": "Switching modes will change how your tasks are stored.",
"uploadTasksQuestion": "Would you like to upload your local tasks to the server?",
"yes": "Yes",
"no": "No"
"no": "No",
"backToSetup": "Back to Setup"
}

View File

@ -559,6 +559,12 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'No'**
String get no;
/// No description provided for @backToSetup.
///
/// In en, this message translates to:
/// **'Back to Setup'**
String get backToSetup;
}
class _AppLocalizationsDelegate

View File

@ -245,4 +245,7 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get no => 'Nein';
@override
String get backToSetup => 'Zurück zur Einrichtung';
}

View File

@ -243,4 +243,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get no => 'No';
@override
String get backToSetup => 'Back to Setup';
}