Create AuthCheckArguments andf add it to / route

This commit is contained in:
2025-01-14 12:57:11 +02:00
parent 1fb3fcb1e6
commit 02e894d00b
2 changed files with 15 additions and 9 deletions

View File

@@ -159,3 +159,13 @@ class ClaimStatementGenerationArguments {
this.sig_path,
);
}
class AuthArguments {
final bool personalSelected;
final bool firstBoot;
AuthArguments(
this.personalSelected,
this.firstBoot,
);
}

View File

@@ -54,21 +54,16 @@ class RouteGenerator {
switch (settings.name) {
// Authgentication
case '/':
if (args is bool) {
if (args is AuthArguments) {
return MaterialPageRoute(
settings: settings,
builder: (_) => AuthCheck(
personalSelected: args,
),
);
} else {
return MaterialPageRoute(
settings: settings,
builder: (_) => const AuthCheck(
personalSelected: true,
personalSelected: args.personalSelected,
firstBoot: args.firstBoot,
),
);
}
return _errorRoute();
case '/notifications':
if (args is NotificationArguments) {
return MaterialPageRoute(
@@ -284,6 +279,7 @@ Route<dynamic> _errorRoute() {
settings: const RouteSettings(name: '/'),
builder: (_) => const AuthCheck(
personalSelected: true,
firstBoot: true,
));
// return MaterialPageRoute(builder: (_) {
// return const Scaffold(