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