added 'completeNow' methods to recipeStep and recipeSubStep
This commit is contained in:
parent
7207686bbc
commit
dfd619a9b7
2 changed files with 12 additions and 0 deletions
|
@ -49,6 +49,14 @@ class RecipeStep extends HiveObject {
|
||||||
completedOn != null;
|
completedOn != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void completeStepNow(){
|
||||||
|
if (subSteps.isNotEmpty){
|
||||||
|
subSteps.forEach((subStep) { subStep.completeNow(); });
|
||||||
|
} else {
|
||||||
|
completedOn = DateTime.now();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int convertToSeconds(int value){
|
int convertToSeconds(int value){
|
||||||
switch (waitUnit){
|
switch (waitUnit){
|
||||||
case "minutes": {
|
case "minutes": {
|
||||||
|
|
|
@ -18,5 +18,9 @@ class RecipeSubStep extends HiveObject {
|
||||||
|
|
||||||
bool get completed => completedOn != null;
|
bool get completed => completedOn != null;
|
||||||
|
|
||||||
|
void completeNow(){
|
||||||
|
completedOn = DateTime.now();
|
||||||
|
}
|
||||||
|
|
||||||
RecipeSubStep(this.name, this.description);
|
RecipeSubStep(this.name, this.description);
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue