action prep, activity association removal, activity ui tweaks
This commit is contained in:
@ -19,9 +19,9 @@ class ActivityTimerModel with ChangeNotifier {
|
||||
|
||||
int get actionCount => _actionCounter;
|
||||
int get currentActionNum => _currentActionNum;
|
||||
dynamic get currentAction => currentSet[_currentActionNum];
|
||||
dynamic get currentAction => currentSet.isNotEmpty ? currentSet[_currentActionNum] : {};
|
||||
int get currentSetNum => _currentSetNum;
|
||||
dynamic get currentSet => _sets[_currentSetNum];
|
||||
dynamic get currentSet => _sets.isNotEmpty ? _sets[_currentSetNum] : {};
|
||||
Activity? get activity => _activity;
|
||||
List get sets => _sets;
|
||||
Timer? get periodicTimer => _periodicTimer;
|
||||
@ -36,7 +36,7 @@ class ActivityTimerModel with ChangeNotifier {
|
||||
_isc = null;
|
||||
_activity = activity;
|
||||
// only one action for now
|
||||
_sets = json.decode(actions[0].set);
|
||||
_sets = actions.isNotEmpty ? json.decode(actions[0].set) : [];
|
||||
// _actions = actions;
|
||||
_currentActionNum = 0;
|
||||
_currentSetNum = 0;
|
||||
@ -92,7 +92,7 @@ class ActivityTimerModel with ChangeNotifier {
|
||||
}
|
||||
|
||||
void setActionCount() {
|
||||
_actionCounter = currentAction['amount'];
|
||||
_actionCounter = currentAction.isNotEmpty ? currentAction['amount'] : 0;
|
||||
}
|
||||
|
||||
void pause() {
|
||||
|
Reference in New Issue
Block a user