fixed bug where waiting on the confirm screen could place the first step into the past
This commit is contained in:
parent
196f2f1d97
commit
d6fb1403de
1 changed files with 9 additions and 0 deletions
|
@ -169,6 +169,15 @@ class AddPizzaEventPageState extends State<AddPizzaEventPage> {
|
||||||
if (eventTime == null){
|
if (eventTime == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the user waited to long on the confirmation dialog that the first step time is now in the past
|
||||||
|
var durationUntilFirstStep = Duration(seconds: this.widget.pizzaRecipe.getCurrentDuration().inSeconds);
|
||||||
|
var firstStepDateTime = eventTime.subtract(durationUntilFirstStep);
|
||||||
|
if (firstStepDateTime.isBefore(DateTime.now())){
|
||||||
|
eventTime = DateTime.now()
|
||||||
|
.add(durationUntilFirstStep)
|
||||||
|
.add(const Duration(minutes: 1));
|
||||||
|
}
|
||||||
|
|
||||||
var pizzaEventsBox = Hive.box<PizzaEvent>("PizzaEvents");
|
var pizzaEventsBox = Hive.box<PizzaEvent>("PizzaEvents");
|
||||||
PizzaEvent pizzaEvent = PizzaEvent(
|
PizzaEvent pizzaEvent = PizzaEvent(
|
||||||
|
|
Loading…
Add table
Reference in a new issue