A simple Dart class for validating email addresses without using RegEx. Can also be used to validate emails within Flutter apps (see Flutter email validation).
NB: This library only validates the syntax of the email, not by looking up domain or whether an email actually exists.
Featured in:
Found in several big libraries and apps:
And many more!
Installation 1. Depend on itAdd this to your package's pubspec.yaml
file:
dependencies: email_validator: '^3.0.0'2. Install it
You can install packages from the command line:
$ pub get ..
Alternatively, your editor might support pub. Check the docs for your editor to learn more.
3. Import itNow in your Dart code, you can use:
import 'package:email_validator/email_validator.dart';Usage
Read the unit tests under test
, or see code example below:
void main() { var email = "fredrik@gmail.com"; assert(EmailValidator.validate(email)); }Tips
You can also use this repo as a template for creating Dart packages, just clone the repo and start hacking :)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4