super_validation 0.0.3 copy "super_validation: ^0.0.3" to clipboard
super_validation: ^0.0.3 copied to clipboard

outdated

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

validation.text = event.text;

And builder for buttons

SuperValidationBuilder(
    superValidation: context.read<TestBloc>().validation,
    builder: (context, validation, isValid) {
        return TextButton(
            onPressed: isValid
                ? () {
                    print('Test');
                    }
                 null,
            child: Text('Test'));
        });
1
likes
0
pub points
29%
popularity

Publisher

unverified uploader

Validation For bloc

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

equatable, flutter

More

Packages that depend on super_validation