regexed_validator 1.0.2

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

Validating:

  • phone
  • name
  • postalCode
  • email
  • url
  • currency
  • ip
  • date
  • time
  • htmlTags
  • password
  • creditCard

For Dart/Flutter developers. Regexed Validator at pub.dartlang.org

Usage

Usage is pretty simple just pass a phone, date, email... to its validation method, see the example below

import 'package:regexed_validator/regexed_validator.dart';

main() {
  print( validator.email('example@example.co.uk') ); // true

  print(validator.url('http://www.nowhere.com?product=28&color=blue')); // true

  print(validator.currency('£498.10')); // true

  print(validator.ip('67.52.159.38')); // true
  
  print(validator.time('14:34 GMT -5')); // true

  print( validator.htmlTags('<strong>Bold</strong>\n'
          '<em>Emphazied</em>\n'
          '<b>Bold</b>\n'
          '<i>Italics</i>\n'
          '<span id="foo" class="bar">Some text</span>\n'
          '<hr />')
  ); // true
}

1.0.2

  • Update README.md usage example and lib description
  • Update CHANGELOG.md
  • Update pubspec.yaml description

1.0.1

  • dartfmt

1.0.0

  • Initial version, created with basic yet functional phone, name, postalCode, email, url, currency, ip, date, time, htmlTags, password, and creditCard validation.

example/main.dart

import 'package:regexed_validator/regexed_validator.dart';

main() {
  print(validator.phone('+(123) - 456-78-90')); // true
  print(validator.name('John Quincy Adams')); // true
  print(validator.postalCode('10010-6543')); // ture
  print(validator.email('example@example.co.uk')); // true
  print(validator.url('http://www.nowhere.com?product=28&color=blue')); // true
  print(validator.currency('£498.10')); // true
  print(validator.ip('67.52.159.38')); // true
  print(validator.date('2000-12-20')); // true
  print(validator.time('14:34 GMT -5')); // true
  print(validator.htmlTags('<strong>Bold</strong>\n'
      '<em>Emphazied</em>\n'
      '<b>Bold</b>\n'
      '<i>Italics</i>\n'
      '<span id="foo" class="bar">Some text</span>\n'
      '<hr />')); // true
  print(validator.password('sword#42Fish')); // true
  print(validator.creditCard('4000-1234-1234-1234')); // true
}

Use this package as a library

1. Depend on it

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


dependencies:
  regexed_validator: ^1.0.2

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:regexed_validator/regexed_validator.dart';
  
Version Uploaded Documentation Archive
1.0.2 Nov 23, 2018 Go to the documentation of regexed_validator 1.0.2 Download regexed_validator 1.0.2 archive
1.0.1 Nov 21, 2018 Go to the documentation of regexed_validator 1.0.1 Download regexed_validator 1.0.1 archive
1.0.0 Nov 21, 2018 Go to the documentation of regexed_validator 1.0.0 Download regexed_validator 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
15
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

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

Health issues and suggestions

Document public APIs (-10 points)

2 out of 2 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0