2026-01-19 14:50:21 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class AuthState extends ChangeNotifier {
|
2026-01-19 14:56:39 +08:00
|
|
|
bool _isLoggedIn = false;
|
|
|
|
|
bool get isLoggedIn => _isLoggedIn;
|
2026-01-19 14:50:21 +08:00
|
|
|
|
2026-01-19 15:48:09 +08:00
|
|
|
void toggleLogin({bool? value}) {
|
|
|
|
|
_isLoggedIn = value ?? !_isLoggedIn;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void logout() {
|
|
|
|
|
_isLoggedIn = false;
|
2026-01-19 14:56:39 +08:00
|
|
|
notifyListeners();
|
2026-01-19 14:50:21 +08:00
|
|
|
}
|
|
|
|
|
}
|