feat: Implement _LoggedInView UI and AuthState improvements
Implements the UI for the _LoggedInView in home_screen.dart, including: - An AppBar with a Profile icon that navigates to the profile screen. - A ListView.builder displaying example items. - A FloatingActionButton.extended for Logout that calls the `authState.logout()` method. - Adds a `logout()` method to `AuthState` to clear the login state. - Modifies the `toggleLogin()` method in `AuthState` to accept an optional boolean value for explicit state control. - Ensured code formatting and resolved any linting issues.
This commit is contained in:
@@ -4,8 +4,13 @@ class AuthState extends ChangeNotifier {
|
||||
bool _isLoggedIn = false;
|
||||
bool get isLoggedIn => _isLoggedIn;
|
||||
|
||||
void toggleLogin() {
|
||||
_isLoggedIn = !_isLoggedIn;
|
||||
void toggleLogin({bool? value}) {
|
||||
_isLoggedIn = value ?? !_isLoggedIn;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void logout() {
|
||||
_isLoggedIn = false;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user