feat: made the ongoing screen... for now

This commit is contained in:
alzalia1 2025-08-14 11:19:06 +02:00
parent 099b20f805
commit e5a8745e0e
5 changed files with 119 additions and 2 deletions

View file

@ -17,6 +17,18 @@ class BalViewModel extends ChangeNotifier {
Bal? get bal => _bal;
bool isABalOngoing = false;
Future<Result<void>> stopBal(int id) async {
final result = await _balRepository.stopBal(id);
switch (result) {
case Ok():
_bal = result.value;
notifyListeners();
break;
default:
}
return result;
}
Future<Result<void>> startBal(int id) async {
if (isABalOngoing) {
return Result.error(Exception("Cannot have multiple BALs ongoing !"));