File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -307,7 +307,11 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
307
307
if (date != null ) {
308
308
if (! mounted) break ;
309
309
final time = await _showTimePicker (currentValue);
310
- newValue = combine (date, time);
310
+ if (time == null ) {
311
+ newValue = null ;
312
+ } else {
313
+ newValue = combine (date, time);
314
+ }
311
315
}
312
316
break ;
313
317
}
@@ -360,7 +364,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
360
364
};
361
365
}
362
366
363
- final timePickerResult = await showTimePicker (
367
+ return await showTimePicker (
364
368
context: context,
365
369
initialTime: currentValue != null
366
370
? TimeOfDay .fromDateTime (currentValue)
@@ -377,8 +381,6 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
377
381
onEntryModeChanged: widget.onEntryModeChanged,
378
382
barrierDismissible: widget.barrierDismissible,
379
383
);
380
- return timePickerResult ??
381
- (currentValue != null ? TimeOfDay .fromDateTime (currentValue) : null );
382
384
}
383
385
384
386
/// Sets the hour and minute of a [DateTime] from a [TimeOfDay] .
You can’t perform that action at this time.
0 commit comments