feat: start of pending screen
This commit is contained in:
parent
019a21f00e
commit
ee9c4c3801
12 changed files with 425 additions and 67 deletions
|
|
@ -24,8 +24,12 @@ class HomeViewModel extends ChangeNotifier {
|
|||
Bal? _currentBal;
|
||||
Bal? get currentBal => _currentBal;
|
||||
|
||||
Future<Result<void>> createBal(String name) async {
|
||||
final result = await _balRepository.addBal(name);
|
||||
Future<Result<void>> createBal(
|
||||
String name,
|
||||
DateTime start,
|
||||
DateTime end,
|
||||
) async {
|
||||
final result = await _balRepository.addBal(name, start, end);
|
||||
switch (result) {
|
||||
case Ok():
|
||||
final result2 = await _balRepository.getBals();
|
||||
|
|
@ -34,7 +38,6 @@ class HomeViewModel extends ChangeNotifier {
|
|||
_bals = result2.value..sort((a, b) => a.compareTo(b));
|
||||
break;
|
||||
case Error():
|
||||
debugPrint("\n\n\n\n${result2.error.toString()}\n\n\n\n");
|
||||
return result2;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Reference in a new issue