28 lines
716 B
Dart
28 lines
716 B
Dart
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 {
|
|
const ContentView({super.key});
|
|
|
|
@override
|
|
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 AuthView();
|
|
}
|
|
}
|
|
}
|