Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/config/providers/auth_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ final authProvider = ChangeNotifierProvider<AuthState>((ref) {
// Note: In actual implementation, you should consider using a more modern approach
// with StateNotifier/StateNotifierProvider or AsyncNotifier/AsyncNotifierProvider
// and adapting the GoRouter to work with that instead of requiring a Listenable.
//
//
// Example of modern approach (requires changes in router_provider.dart):
//
//
// class AuthState {
// final bool isAuthenticated;
// AuthState({this.isAuthenticated = false});
// }
//
//
// class AuthNotifier extends Notifier<AuthState> {
// @override
// AuthState build() => AuthState();
//
//
// void login() => state = AuthState(isAuthenticated: true);
// void logout() => state = AuthState(isAuthenticated: false);
// }
//
// final authNotifierProvider = NotifierProvider<AuthNotifier, AuthState>(() => AuthNotifier());
//
// final authNotifierProvider = NotifierProvider<AuthNotifier, AuthState>(() => AuthNotifier());
Loading