Change PIN to 1451

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
ARCHITECT
2026-01-17 23:31:52 +00:00
parent c152cacb90
commit f199daf4ba
171 changed files with 10492 additions and 2 deletions

View File

@@ -0,0 +1,52 @@
import 'package:flutter/foundation.dart';
import '../services/auth_service.dart';
class AuthProvider with ChangeNotifier {
final AuthService _authService = AuthService();
bool _isLoading = false;
String? _error;
bool get isLoading => _isLoading;
bool get isAuthenticated => _authService.isAuthenticated;
String? get token => _authService.token;
String? get username => _authService.username;
String? get error => _error;
Future<void> init() async {
_isLoading = true;
notifyListeners();
await _authService.loadStoredAuth();
_isLoading = false;
notifyListeners();
}
Future<bool> login(String username, String password) async {
_isLoading = true;
_error = null;
notifyListeners();
final success = await _authService.login(username, password);
if (!success) {
_error = _authService.lastError ?? 'Login failed';
}
_isLoading = false;
notifyListeners();
return success;
}
Future<void> logout() async {
await _authService.logout();
notifyListeners();
}
void clearError() {
_error = null;
notifyListeners();
}
}