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:
soragui
2026-01-19 15:48:09 +08:00
parent fd5f38bd6f
commit 4d0207f41f
2 changed files with 43 additions and 3 deletions

View File

@@ -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();
}
}