Commit 6420c75f authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Handle cancellation of the date/time picker in the Gallery full screen dialog demo (#12248)

parent 48e64405
......@@ -51,7 +51,8 @@ class DateTimeItem extends StatelessWidget {
lastDate: date.add(const Duration(days: 30))
)
.then<Null>((DateTime value) {
onChanged(new DateTime(value.year, value.month, value.day, time.hour, time.minute));
if (value != null)
onChanged(new DateTime(value.year, value.month, value.day, time.hour, time.minute));
});
},
child: new Row(
......@@ -77,7 +78,8 @@ class DateTimeItem extends StatelessWidget {
initialTime: time
)
.then<Null>((TimeOfDay value) {
onChanged(new DateTime(date.year, date.month, date.day, value.hour, value.minute));
if (value != null)
onChanged(new DateTime(date.year, date.month, date.day, value.hour, value.minute));
});
},
child: new Row(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment