From e2aededeecc3e0a61038ded162aebcadb806a54e Mon Sep 17 00:00:00 2001 From: geronimol <56521222+geronimol@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:39:04 -0300 Subject: [PATCH] Add "barrierDismissible" to DateTime picker --- lib/src/fields/form_builder_date_time_picker.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/fields/form_builder_date_time_picker.dart b/lib/src/fields/form_builder_date_time_picker.dart index 84c70f3f4..5e7389d36 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; @@ -342,6 +344,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< currentDate: widget.currentDate, anchorPoint: widget.anchorPoint, keyboardType: widget.keyboardType, + barrierDismissible: widget.barrierDismissible, ); } @@ -375,6 +378,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);