diff --git a/lib/src/fields/form_builder_date_time_picker.dart b/lib/src/fields/form_builder_date_time_picker.dart index 3ba64c737..82a2adf23 100644 --- a/lib/src/fields/form_builder_date_time_picker.dart +++ b/lib/src/fields/form_builder_date_time_picker.dart @@ -125,6 +125,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration { final SelectableDayPredicate? selectableDayPredicate; final Offset? anchorPoint; final EntryModeChangeCallback? onEntryModeChanged; + final bool barrierDismissible; /// Creates field for `Date`, `Time` and `DateTime` input FormBuilderDateTimePicker({ @@ -195,6 +196,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration { this.selectableDayPredicate, this.anchorPoint, this.onEntryModeChanged, + this.barrierDismissible = true, }) : super( builder: (FormFieldState field) { final state = field as _FormBuilderDateTimePickerState; @@ -339,6 +341,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< currentDate: widget.currentDate, anchorPoint: widget.anchorPoint, keyboardType: widget.keyboardType, + barrierDismissible: widget.barrierDismissible, ); } @@ -372,6 +375,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< anchorPoint: widget.anchorPoint, errorInvalidText: widget.errorInvalidText, onEntryModeChanged: widget.onEntryModeChanged, + barrierDismissible: widget.barrierDismissible, ); return timePickerResult ?? (currentValue != null ? TimeOfDay.fromDateTime(currentValue) : null);