@@ -189,15 +189,6 @@ class FormBuilderCupertinoDateTimePicker extends FormBuilderField<DateTime> {
189189 /// null, the row is shorter.
190190 final Widget ? helper;
191191
192- /// A builder widget that is displayed underneath the [prefix] and [child] widgets.
193- ///
194- /// The [error] widget is primarily used to inform users of input errors. When
195- /// a [Text] is given to [error] , it will be shown in
196- /// [CupertinoColors.destructiveRed] coloring and medium-weighted font. The
197- /// row becomes taller in order to display the [helper] widget underneath
198- /// [prefix] and [child] . If null, the row is shorter.
199- final Widget ? Function (String error)? errorBuilder;
200-
201192 /// Preset the widget's value.
202193 final bool autofocus;
203194 final bool obscureText;
@@ -255,6 +246,7 @@ class FormBuilderCupertinoDateTimePicker extends FormBuilderField<DateTime> {
255246 super .onReset,
256247 super .focusNode,
257248 super .restorationId,
249+ super .errorBuilder,
258250 this .inputType = InputType .both,
259251 this .scrollPadding = const EdgeInsets .all (20.0 ),
260252 this .cursorWidth = 2.0 ,
@@ -267,7 +259,6 @@ class FormBuilderCupertinoDateTimePicker extends FormBuilderField<DateTime> {
267259 this .prefix,
268260 this .contentPadding,
269261 this .helper,
270- this .errorBuilder,
271262 this .autofocus = false ,
272263 this .obscureText = false ,
273264 this .autocorrect = true ,
@@ -349,7 +340,7 @@ class FormBuilderCupertinoDateTimePicker extends FormBuilderField<DateTime> {
349340 return CupertinoFormRow (
350341 error: state.hasError
351342 ? errorBuilder != null
352- ? errorBuilder (state.errorText ?? '' )
343+ ? errorBuilder (state.context, state. errorText ?? '' )
353344 : Text (state.errorText ?? '' )
354345 : null ,
355346 helper: helper,
0 commit comments