Skip to content

Commit a4a8574

Browse files
committed
chore: Rename readOnly parameter to disablePicker and add docs
1 parent b73e503 commit a4a8574

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/src/fields/form_builder_date_time_picker.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
123123
final EntryModeChangeCallback? onEntryModeChanged;
124124
final bool barrierDismissible;
125125

126-
final bool readOnly;
126+
/// If true, disables the picker so it's not shown when the field is tapped.
127+
final bool disablePicker;
127128

128129
/// Creates field for `Date`, `Time` and `DateTime` input
129130
FormBuilderDateTimePicker({
@@ -193,7 +194,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
193194
this.selectableDayPredicate,
194195
this.anchorPoint,
195196
this.onEntryModeChanged,
196-
this.readOnly = false,
197+
this.disablePicker = false,
197198
this.barrierDismissible = true,
198199
}) : super(
199200
builder: (FormFieldState<DateTime?> field) {
@@ -202,7 +203,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
202203
return FocusTraversalGroup(
203204
policy: ReadingOrderTraversalPolicy(),
204205
child: TextField(
205-
onTap: readOnly ? () {} : () => state.showPicker(),
206+
onTap: disablePicker ? () {} : () => state.showPicker(),
206207
textDirection: textDirection,
207208
textAlign: textAlign,
208209
textAlignVertical: textAlignVertical,

0 commit comments

Comments
 (0)