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.
17 lines
326 B
Dart
17 lines
326 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class AuthState extends ChangeNotifier {
|
|
bool _isLoggedIn = false;
|
|
bool get isLoggedIn => _isLoggedIn;
|
|
|
|
void toggleLogin({bool? value}) {
|
|
_isLoggedIn = value ?? !_isLoggedIn;
|
|
notifyListeners();
|
|
}
|
|
|
|
void logout() {
|
|
_isLoggedIn = false;
|
|
notifyListeners();
|
|
}
|
|
}
|