fix(01-10): fix home page syntax and add dependency
- Fixed all syntax errors in HomePage - Added flutter_riverpod dependency to pubspec.yaml - HomePage now properly uses AuthProvider for state management - Added proper confirmation dialog for logout - Added error display and loading states - Cleaned up null-aware operators and formatting
This commit is contained in:
@@ -15,7 +15,6 @@ class HomePage extends ConsumerWidget {
|
||||
final currentUser = authState.user;
|
||||
final authNotifier = ref.read(authProvider.notifier);
|
||||
|
||||
return Scaffold(
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Sage'),
|
||||
@@ -116,8 +115,8 @@ class HomePage extends ConsumerWidget {
|
||||
radius: 50,
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
child: Text(
|
||||
(currentUser?.email.isNotEmpty ?? false)
|
||||
? currentUser!.email[0].toUpperCase()
|
||||
(currentUser.email.isNotEmpty)
|
||||
? currentUser.email[0].toUpperCase()
|
||||
: 'U',
|
||||
style: const TextStyle(
|
||||
fontSize: 24,
|
||||
@@ -135,13 +134,13 @@ class HomePage extends ConsumerWidget {
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
currentUser?.email ?? '',
|
||||
currentUser.email,
|
||||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
),
|
||||
] else ...[
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.account_circle,
|
||||
size: 100,
|
||||
color: Colors.grey[400],
|
||||
@@ -195,12 +194,13 @@ class HomePage extends ConsumerWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,7 @@ dependencies:
|
||||
go_router: ^13.0.0
|
||||
|
||||
# State management
|
||||
flutter_riverpod: ^2.5.0
|
||||
riverpod: ^2.5.0
|
||||
|
||||
# Secure storage for authentication tokens
|
||||
|
||||
Reference in New Issue
Block a user