fix a random bug

This commit is contained in:
Dieter Plaetinck
2024-05-08 18:18:32 +02:00
parent 7fffa94925
commit cfd47bc20b

View File

@@ -65,8 +65,9 @@ class MealForm extends StatelessWidget {
context: context,
initialTime: _meal.time!,
);
_timeController.text = timeToString(pickedTime)!;
if (pickedTime != null) {
_timeController.text = timeToString(pickedTime)!;
}
},
onSaved: (newValue) {
_meal.time = stringToTime(newValue);