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> {
123123 final EntryModeChangeCallback ? onEntryModeChanged;
124124 final bool barrierDismissible;
125125
126+ final bool readOnly;
127+
126128 /// Creates field for `Date` , `Time` and `DateTime` input
127129 FormBuilderDateTimePicker ({
128130 super .key,
@@ -191,6 +193,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
191193 this .selectableDayPredicate,
192194 this .anchorPoint,
193195 this .onEntryModeChanged,
196+ this .readOnly = false ,
194197 this .barrierDismissible = true ,
195198 }) : super (
196199 builder: (FormFieldState <DateTime ?> field) {
@@ -199,7 +202,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration<DateTime> {
199202 return FocusTraversalGroup (
200203 policy: ReadingOrderTraversalPolicy (),
201204 child: TextField (
202- onTap: () => state.showPicker (),
205+ onTap: readOnly ? () {} : () => state.showPicker (),
203206 textDirection: textDirection,
204207 textAlign: textAlign,
205208 textAlignVertical: textAlignVertical,
You can’t perform that action at this time.
0 commit comments