|
1 | 1 | import 'package:flutter/widgets.dart'; |
2 | 2 | import 'package:flutter_form_builder/flutter_form_builder.dart'; |
3 | | -import 'package:flutter_form_builder/src/extensions/autovalidatemode_extension.dart'; |
4 | 3 |
|
5 | 4 | enum OptionsOrientation { horizontal, vertical, wrap, auto } |
6 | 5 |
|
@@ -98,16 +97,13 @@ class FormBuilderFieldState<F extends FormBuilderField<T>, T> |
98 | 97 | bool get hasError => super.hasError || errorText != null; |
99 | 98 |
|
100 | 99 | @override |
101 | | - bool get isValid => super.isValid && errorText == null; |
| 100 | + bool get isValid => super.isValid && _customErrorText == null; |
102 | 101 |
|
103 | 102 | bool get valueIsValid => super.isValid; |
104 | 103 | bool get valueHasError => super.hasError; |
105 | 104 |
|
106 | 105 | bool get enabled => widget.enabled && (_formBuilderState?.enabled ?? true); |
107 | 106 | bool get readOnly => !(_formBuilderState?.widget.skipDisabled ?? false); |
108 | | - bool get _isAlwaysValidate => |
109 | | - widget.autovalidateMode.isAlways || |
110 | | - (_formBuilderState?.widget.autovalidateMode?.isAlways ?? false); |
111 | 107 |
|
112 | 108 | /// Will be true if the field is dirty |
113 | 109 | /// |
@@ -140,11 +136,6 @@ class FormBuilderFieldState<F extends FormBuilderField<T>, T> |
140 | 136 | focusAttachment = effectiveFocusNode.attach(context); |
141 | 137 |
|
142 | 138 | // Verify if need auto validate form |
143 | | - if ((enabled || readOnly) && _isAlwaysValidate) { |
144 | | - WidgetsBinding.instance.addPostFrameCallback((_) { |
145 | | - validate(); |
146 | | - }); |
147 | | - } |
148 | 139 | } |
149 | 140 |
|
150 | 141 | @override |
|
0 commit comments