email_validator 1.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new85

Email validator Build status

A simple (but correct) Dart class for validating email addresses.

Installation

Dart requires the latest version of Dart. You can download the latest and greatest here.

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
    email_validator: '^1.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 it

Now 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) == true);

}

1.0.0

  • EmailValidator.Validate() is now, by Dart convention, EmailValidator.validate().

0.1.6

  • Cleaned up code a bit, no API changes.

0.1.5

  • Cleaned up code a bit, no API changes.

0.1.4

  • Now supports a broader variety of Dart sdk versions

0.1.0

  • Validate emails through a static method EmailValidator.validate().

example/example.dart

import 'dart:core';
import 'package:email_validator/email_validator.dart';

void main() {
    const String email = 'fredrik.eilertsen@gmail.com';
    final bool isValid = EmailValidator.validate(email);

    print('Email is valid? ' + (isValid ? 'yes' : 'no'));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  email_validator: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:email_validator/email_validator.dart';
  
Version Uploaded Documentation Archive
1.0.0 Sep 5, 2018 Go to the documentation of email_validator 1.0.0 Download email_validator 1.0.0 archive
0.1.6 Sep 4, 2018 Go to the documentation of email_validator 0.1.6 Download email_validator 0.1.6 archive
0.1.5 Sep 4, 2018 Go to the documentation of email_validator 0.1.5 Download email_validator 0.1.5 archive
0.1.4 Sep 1, 2018 Go to the documentation of email_validator 0.1.4 Download email_validator 0.1.4 archive
0.1.0 Aug 31, 2018 Go to the documentation of email_validator 0.1.0 Download email_validator 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
70
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
85
Learn more about scoring.

We analyzed this package on Sep 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:email_validator/email_validator.dart.

Suggestions

Format lib/email_validator.dart.

Run dartfmt to format lib/email_validator.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.0 <3.0.0
Dev dependencies
test ^1.3.0