Skip to content

Commit

Permalink
Handle cancellation of the date/time picker in the Gallery full scree…
Browse files Browse the repository at this point in the history
…n dialog demo (flutter#12248)
  • Loading branch information
jason-simmons committed Sep 25, 2017
1 parent 48e6440 commit 6420c75
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 6420c75

Please sign in to comment.