Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always required #30

Open
Paroca72 opened this issue Dec 22, 2021 · 1 comment
Open

Always required #30

Paroca72 opened this issue Dec 22, 2021 · 1 comment

Comments

@Paroca72
Copy link

It seems the field is always required

final ValidationBuilder validationBuilder = ValidationBuilder().email('Wrong Email Format');
String? _errorText = validationBuilder.build()(null);

Result "The field is required"

final ValidationBuilder validationBuilder = ValidationBuilder().email('Wrong Email Format');
String? _errorText = validationBuilder.build()('');

Result "Wrong Email Format"

@themisir
Copy link
Owner

You can set optional parameter when constructing ValidationBuilder to set value as optional (not-required). In that case if null or empty string value is provided the validation will be passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants