Last updated:
0 purchases
email validator flutter
Email_Validator_Flutter #
Email validator Flutter and Dart package is used to validate email addresses both in Dart and Flutter. It uses Regex for validation. It is purely based on Dart, with no other dependencies. I will share a link to a complete example of a project in which I have used this email validation in Flutter
Installation #
1. Add Dependency #
Add this to your package's pubspec.yaml file:
dependencies:
email_validator_flutter: "^1.0.0"
copied to clipboard
OR, you can use pub command to this email validator flutter package.
Like this:
$ dart pub add email_validator_flutter
copied to clipboard
2. Install it
You can install packages from the command line:
$ pub get
copied to clipboard
3. Import it
Now in your Dart code, you can use:
import 'package:email_validator_flutter/email_validator_flutter.dart';
copied to clipboard
Usage #
Read the unit tests under test, or see the code example below:
void main() {
EmailValidatorFlutter emailValidatorFlutter = EmailValidatorFlutter();
final email1 = '[email protected]';
final email2 = 'invalid_email@';
print('$email1 is valid: ${emailValidatorFlutter.validateEmail(email1)}');
print('$email2 is valid: ${emailValidatorFlutter.validateEmail(email2)}');
}
copied to clipboard
Extras #
I have created this Flutter email validation package. If you get benefited
from it please like and share it.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.