Skip to content

Commit 04d5896

Browse files
committed
fix: change DateTime Picker behavior when user presses "cancel" button
1 parent 36e9c36 commit 04d5896

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/src/fields/form_builder_date_time_picker.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
364364
};
365365
}
366366

367-
final timePickerResult = await showTimePicker(
367+
return await showTimePicker(
368368
context: context,
369369
initialTime: currentValue != null
370370
? TimeOfDay.fromDateTime(currentValue)
@@ -380,8 +380,6 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
380380
errorInvalidText: widget.errorInvalidText,
381381
onEntryModeChanged: widget.onEntryModeChanged,
382382
);
383-
return timePickerResult ??
384-
(currentValue != null ? TimeOfDay.fromDateTime(currentValue) : null);
385383
}
386384

387385
/// Sets the hour and minute of a [DateTime] from a [TimeOfDay].

0 commit comments

Comments
 (0)