Skip to content

Commit

Permalink
Merge pull request #1443 from geronimol/date-picker-barrier-dismissible
Browse files Browse the repository at this point in the history
Add "barrierDismissible" to DateTime picker
  • Loading branch information
deandreamatias authored Dec 18, 2024
2 parents 51bdeee + 59788a3 commit 3c217bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/fields/form_builder_date_time_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
final SelectableDayPredicate? selectableDayPredicate;
final Offset? anchorPoint;
final EntryModeChangeCallback? onEntryModeChanged;
final bool barrierDismissible;

/// Creates field for `Date`, `Time` and `DateTime` input
FormBuilderDateTimePicker({
Expand Down Expand Up @@ -195,6 +196,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
this.selectableDayPredicate,
this.anchorPoint,
this.onEntryModeChanged,
this.barrierDismissible = true,
}) : super(
builder: (FormFieldState<DateTime?> field) {
final state = field as _FormBuilderDateTimePickerState;
Expand Down Expand Up @@ -339,6 +341,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
currentDate: widget.currentDate,
anchorPoint: widget.anchorPoint,
keyboardType: widget.keyboardType,
barrierDismissible: widget.barrierDismissible,
);
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3c217bb

Please sign in to comment.