email_validator_flutter 1.0.0 copy "email_validator_flutter: ^1.0.0" to clipboard
email_validator_flutter: ^1.0.0 copied to clipboard

Email validator flutter and dart package is used to validate email address both in dart and flutter.

Email_Validator_Flutter pub package #

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"

OR, you can use pub command to this email validator flutter package. Like this:

$ dart pub add email_validator_flutter

2. Install it

You can install packages from the command line:

$ pub get

3. Import it

Now in your Dart code, you can use:

import 'package:email_validator_flutter/email_validator_flutter.dart';

Usage #

Read the unit tests under test, or see the code example below:

void main() {

  EmailValidatorFlutter emailValidatorFlutter = EmailValidatorFlutter();
  final email1 = 'test@example.com';
  final email2 = 'invalid_email@';

  print('$email1 is valid: ${emailValidatorFlutter.validateEmail(email1)}');
  print('$email2 is valid: ${emailValidatorFlutter.validateEmail(email2)}');
}

Extras #

I have created this Flutter email validation package. If you get benefited from it please like and share it.

14
likes
130
pub points
79%
popularity

Publisher

verified publisherwriticle.org

Email validator flutter and dart package is used to validate email address both in dart and flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on email_validator_flutter