Repository: flutter-form-builder-ecosystem/flutter_form_builder

Issue:
I just wanna run isValid
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Package/Plugin version

1

### Platforms

- [ ] Android
- [ ] iOS
- [ ] Linux
- [ ] MacOS
- [ ] Web
- [ ] Windows

### Flutter doctor

-


### Minimal code example

-

### Current Behavior

-

### Expected Behavior

-

### Steps To Reproduce

-

### Aditional information

<img width="1257" alt="image" src="https://github.com/flutter-form-builder-ecosystem/flutter_form_builder/assets/16184922/e4da85d5-0ec6-4d1b-9fa2-197f65aaeb96">


I just want to get isValid with out errorText, PLEASE!!!!



Fix patch:
diff --git a/lib/src/form_builder_field.dart b/lib/src/form_builder_field.dart
index 03827a8c0..81bfea8c0 100644
--- a/lib/src/form_builder_field.dart
+++ b/lib/src/form_builder_field.dart
@@ -99,6 +99,9 @@ class FormBuilderFieldState<F extends FormBuilderField<T>, T>
   @override
   bool get isValid => super.isValid && errorText == null;
 
+  bool get valueIsValid => super.isValid;
+  bool get valueHasError => super.hasError;
+
   bool get enabled => widget.enabled && (_formBuilderState?.enabled ?? true);
   bool get readOnly => !(_formBuilderState?.widget.skipDisabled ?? false);
   bool get _isAlwaysValidate =>


Test patch:
diff --git a/test/src/form_builder_field_test.dart b/test/src/form_builder_field_test.dart
index 1af8a610b..24ce41ffc 100644
--- a/test/src/form_builder_field_test.dart
+++ b/test/src/form_builder_field_test.dart
@@ -125,6 +125,46 @@ void main() {
       });
     });
 
+    group('valueIsValid -', () {
+      testWidgets(
+          'Should value is valid when validator passes, despite set custom error',
+          (tester) async {
+        final textFieldKey = GlobalKey<FormBuilderFieldState>();
+        const textFieldName = 'text';
+        const errorTextField = 'error text field';
+        final testWidget = FormBuilderTextField(
+          name: textFieldName,
+          key: textFieldKey,
+        );
+        await tester.pumpWidget(buildTestableFieldWidget(testWidget));
+
+        // Set custom error
+        textFieldKey.currentState?.invalidate(errorTextField);
+        await tester.pumpAndSettle();
+
+        expect(textFieldKey.currentState?.valueIsValid, isTrue);
+      });
+    });
+
+    group('valueHasError -', () {
+      testWidgets('Should value is invalid when validator passes',
+          (tester) async {
+        final textFieldKey = GlobalKey<FormBuilderFieldState>();
+        const textFieldName = 'text';
+        const invalidValue = 'invalid';
+        final testWidget = FormBuilderTextField(
+          name: textFieldName,
+          key: textFieldKey,
+          initialValue: invalidValue,
+          validator: (value) => (value == invalidValue) ? 'error' : null,
+          autovalidateMode: AutovalidateMode.always,
+        );
+        await tester.pumpWidget(buildTestableFieldWidget(testWidget));
+
+        expect(textFieldKey.currentState?.valueHasError, isTrue);
+      });
+    });
+
     group('autovalidateMode -', () {
       testWidgets(
           'Should show error when init form and AutovalidateMode is always',