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<
307307 if (date != null ) {
308308 if (! mounted) break ;
309309 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+ }
311315 }
312316 break ;
313317 }
@@ -360,7 +364,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
360364 };
361365 }
362366
363- final timePickerResult = await showTimePicker (
367+ return await showTimePicker (
364368 context: context,
365369 initialTime: currentValue != null
366370 ? TimeOfDay .fromDateTime (currentValue)
@@ -377,8 +381,6 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
377381 onEntryModeChanged: widget.onEntryModeChanged,
378382 barrierDismissible: widget.barrierDismissible,
379383 );
380- return timePickerResult ??
381- (currentValue != null ? TimeOfDay .fromDateTime (currentValue) : null );
382384 }
383385
384386 /// Sets the hour and minute of a [DateTime] from a [TimeOfDay] .
You can’t perform that action at this time.
0 commit comments