data_validator 1.0.1

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

data_validator #

A simple data validation

Getting Started #

In your project add the dependency:

dependencies:
  ...
  data_validator: any

Usage example #

import 'package:data_validator/data_validator.dart';
import 'package:data_validator/data_validator.dart';

void main() {
  print('running');
  print(DataValidator.isEmail("john@abc.com"));
  print(DataValidator.isPhoneNumber("9841580604"));
  print(DataValidator.isURL("https://www.google.com"));
  print(DataValidator.isFloat("4.5"));
  print(DataValidator.isIP("127.0.0.1"));
  print(DataValidator.toBoolean('true'));
  print(DataValidator.isJSON('{"name" : "John Doe"}'));
}


1.0.0 #

  • Initial Release

1.0.1 #

  • Supports all

example/example.dart

import 'package:data_validator/data_validator.dart';

void main() {
  print('running');
  print(DataValidator.isEmail("john@abc.com"));
  print(DataValidator.isPhoneNumber("9841580604"));
  print(DataValidator.isURL("https://www.google.com"));
  print(DataValidator.isFloat("4.5"));
  print(DataValidator.isIP("127.0.0.1"));
  print(DataValidator.toBoolean('true'));
  print(DataValidator.isJSON('{"name" : "John Doe"}'));
}

Use this package as a library

1. Depend on it

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


dependencies:
  data_validator: ^1.0.1

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:data_validator/data_validator.dart';
  
Version Uploaded Documentation Archive
1.0.1 Feb 5, 2019 Go to the documentation of data_validator 1.0.1 Download data_validator 1.0.1 archive
1.0.0 Feb 5, 2019 Go to the documentation of data_validator 1.0.0 Download data_validator 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
37
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Apr 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Fix lib/data_validator.dart. (-2.96 points)

Analysis of lib/data_validator.dart reported 6 hints, including:

line 40 col 7: Use isNotEmpty instead of length

line 79 col 12: Use contains instead of indexOf

line 125 col 11: Use isEmpty instead of length

line 212 col 27: Use isEmpty instead of length

line 431 col 9: Use isEmpty instead of length

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0