feat: made the ongoing screen... for now
This commit is contained in:
parent
099b20f805
commit
e5a8745e0e
5 changed files with 119 additions and 2 deletions
|
|
@ -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 !"));
|
||||
|
|
|
|||
Reference in a new issue