-
Notifications
You must be signed in to change notification settings - Fork 86
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
[Feature request]Validation String extension #86
Comments
@shinriyo I like the idea. What else could we validate? Emails, URLs, ... |
@leisim both of them. |
@shinriyo Phone numbers are super complicated to validate. I think this should be a separate package (see github.com/google/libphonenumber) |
@leisim Thank you. I checked the URL's contents. but, there are not dart languages though it is google official language. |
We should avoid adding too many extensions on For such cases I suggest creating new packages, like an email validator which could also contain validation logic. final String mailAddress = json["email"] as String;
final EmailAddress email = EmailAddress.tryParse(mailAddress);
if (email != null) {
print("Email is valid");
} Side note: Email validation is as tricky as phone number validation. Probably impossible to cover in a single regex. I'd be happy if there is a package with like 100 tests for it 😉 |
validation extension is also concept?
like this
If it is. I will do pull-request.
The text was updated successfully, but these errors were encountered: