Split welcome and add authview
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../services/authentication_manager.dart';
|
||||
import 'welcome_view.dart';
|
||||
import 'auth_view.dart';
|
||||
import 'main_view.dart';
|
||||
|
||||
class ContentView extends StatelessWidget {
|
||||
@@ -11,10 +12,16 @@ class ContentView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final authManager = context.watch<AuthenticationManager>();
|
||||
|
||||
// Show splash screen while initializing
|
||||
if (authManager.isInitializing) {
|
||||
return const WelcomeView();
|
||||
}
|
||||
|
||||
// Show main view if authenticated, otherwise show login
|
||||
if (authManager.isAuthenticated) {
|
||||
return const MainView();
|
||||
} else {
|
||||
return const WelcomeView();
|
||||
return const AuthView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user