fix: continuing error managment and documentation

This commit is contained in:
alzalia1 2025-08-23 12:35:36 +02:00
parent 59e1c2558c
commit dad000a1b9
24 changed files with 389 additions and 182 deletions

View file

@ -13,8 +13,10 @@ class LoginViewModel extends ChangeNotifier {
final AuthRepository _authRepository;
/// Command to login with added capabilities
late Command1 login;
/// Logins the user with credentials [(String username, String password)]
Future<Result<void>> _login((String, String) credentials) async {
final (username, password) = credentials;
final result = await _authRepository.login(username, password);
@ -27,10 +29,12 @@ class LoginViewModel extends ChangeNotifier {
* =================================
*/
/// Loads all necessary data
late final Command0 load;
bool isLoaded = false;
bool isUpToDate = false;
/// Manages loaders
Future<Result<void>> _load() async {
final result1 = await _loadApiVersion();
switch (result1) {
@ -44,6 +48,7 @@ class LoginViewModel extends ChangeNotifier {
return result1;
}
/// Loads the current remote api version and compares to local hardcoded [apiVersion]
Future<Result<void>> _loadApiVersion() async {
final result = await _authRepository.getRemoteApiVersion();
switch (result) {