super_validation 0.0.1 super_validation: ^0.0.1 copied to clipboard
Validation For bloc
Package to controll TextFormField from bloc
Usage #
In test_bloc.dart
final SuperValidation validation = SuperValidation((value) {
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
return null;
});
In test_page.dart
TextFieldSuperValidation(
superValidation: context.read<TestBloc>().validation,
autovalidateMode: AutovalidateMode.onUserInteraction,
),
Also u can enforse set Validation text with
validation.validate('Validation Text');
And set text of textField
```dart
validation.text = event.text;
```