File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
123
123
final EntryModeChangeCallback ? onEntryModeChanged;
124
124
final bool barrierDismissible;
125
125
126
+ final bool readOnly;
127
+
126
128
/// Creates field for `Date` , `Time` and `DateTime` input
127
129
FormBuilderDateTimePicker ({
128
130
super .key,
@@ -191,6 +193,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
191
193
this .selectableDayPredicate,
192
194
this .anchorPoint,
193
195
this .onEntryModeChanged,
196
+ this .readOnly = false ,
194
197
this .barrierDismissible = true ,
195
198
}) : super (
196
199
builder: (FormFieldState <DateTime ?> field) {
@@ -199,7 +202,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
199
202
return FocusTraversalGroup (
200
203
policy: ReadingOrderTraversalPolicy (),
201
204
child: TextField (
202
- onTap: () => state.showPicker (),
205
+ onTap: readOnly ? () {} : () => state.showPicker (),
203
206
textDirection: textDirection,
204
207
textAlign: textAlign,
205
208
textAlignVertical: textAlignVertical,
You can’t perform that action at this time.
0 commit comments