First commit

This commit is contained in:
2025-03-17 13:58:47 +01:00
commit fff5617757
159 changed files with 6972 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import 'package:flutter/cupertino.dart';
import 'package:sampleapp/services/auth/auth.dart';
class AuthViewModel extends ChangeNotifier {
final AuthService authService;
bool loggingIn = false;
bool loggingOut = false;
AuthViewModel(this.authService);
Future<bool> login() {
return Future.delayed(Duration.zero, () async {
loggingIn = true;
notifyListeners();
await authService.login();
loggingIn = false;
notifyListeners();
return authService.isLoggedIn();
});
}
Future<bool> logout() async {
loggingOut = true;
notifyListeners();
await authService.logout();
loggingOut = false;
notifyListeners();
return !(await authService.isLoggedIn());
}
}