feat: add auth screens and state management

This commit is contained in:
soragui
2026-01-19 14:50:21 +08:00
parent 58c40c5f00
commit 0ade16350a
10 changed files with 291 additions and 1 deletions

18
lib/auth/auth_state.dart Normal file
View File

@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';
class AuthState extends ChangeNotifier {
User? _user;
User? get user => _user;
final FirebaseAuth _auth = FirebaseAuth.instance;
AuthState() {
_auth.authStateChanges().listen((user) {
_user = user;
notifyListeners();
});
}
bool get isLoggedIn => _user != null;
}