Logo
Explore Help
Sign In
flutter/phone_login
1
0
Fork 0
You've already forked phone_login
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
f0bee915991953c3e25345df12ec1dfafb8c5bb1
phone_login/lib/auth/auth_state.dart

17 lines
326 B
Dart
Raw Normal View History

feat: add auth screens and state management
2026-01-19 14:50:21 +08:00
import 'package:flutter/material.dart';
class AuthState extends ChangeNotifier {
feat: add home and profile screens
2026-01-19 14:56:39 +08:00
bool _isLoggedIn = false;
bool get isLoggedIn => _isLoggedIn;
feat: add auth screens and state management
2026-01-19 14:50:21 +08:00
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.
2026-01-19 15:48:09 +08:00
void toggleLogin({bool? value}) {
_isLoggedIn = value ?? !_isLoggedIn;
notifyListeners();
}
void logout() {
_isLoggedIn = false;
feat: add home and profile screens
2026-01-19 14:56:39 +08:00
notifyListeners();
feat: add auth screens and state management
2026-01-19 14:50:21 +08:00
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 21ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API