feat: add home and profile screens
This commit is contained in:
@@ -1,18 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
|
||||
class AuthState extends ChangeNotifier {
|
||||
User? _user;
|
||||
User? get user => _user;
|
||||
bool _isLoggedIn = false;
|
||||
bool get isLoggedIn => _isLoggedIn;
|
||||
|
||||
final FirebaseAuth _auth = FirebaseAuth.instance;
|
||||
|
||||
AuthState() {
|
||||
_auth.authStateChanges().listen((user) {
|
||||
_user = user;
|
||||
notifyListeners();
|
||||
});
|
||||
void toggleLogin() {
|
||||
_isLoggedIn = !_isLoggedIn;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
bool get isLoggedIn => _user != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user