ec_validations 0.0.14 copy "ec_validations: ^0.0.14" to clipboard
ec_validations: ^0.0.14 copied to clipboard

A library for validating Ecuadorian identification documents (ID card and RUC).

ec_validator #

A library for validating Ecuadorian identification documents (ID card and RUC)."

Null-Safety, Dart 3, with zero external dependencies

iOS, Android, Linux, Mac, Web, Windows ready

ec_validator demo

Documentation #

Documentation

Installation #

1. Depend on it #

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

dependencies:
    ec_validations: '^0.0.14'

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:ec_validations/ec_validations.dart';

Usage/Examples #

For complete examples, check the example folder inside the repository

void main() {
  final result = DniValidator
   .isValid('0105566046');
  /**
   * isValid: true or false
   * errorMessage: null or error string message
   * typeCodeError: null or error code
  */
  final resultRucPerson = RucValidator
   .validateRucByType('0105566046001', TypeIdentification.rucPersonNatural);
  /**
   * isValid: true or false
   * errorMessage: null or error string message
   * typeCodeError: null or error code
  */
  final resultRuc = RucValidator.validateRuc('0105566046001');
  /**
   * isValid: true or false
   * errorMessage: null or error string message
   * typeCodeError: null or error code
  */
  final resultPossiblyValidRuc = RucValidator.isPossiblyValidRuc('0391034039001');
  /**
   * isValid: true or false
   * errorMessage: null or error string message
   * typeCodeError: null or error code
  */
}

Demo form valid DNI

ec_validator form_dni

Demo form valid RUC

ec_validator form_ruc

Running Tests #

To run tests, run the following command

  flutter test

License #

LICENSE

Authors #

1
likes
160
points
70
downloads

Publisher

unverified uploader

Weekly Downloads

A library for validating Ecuadorian identification documents (ID card and RUC).

Homepage
Repository (GitHub)
View/report issues

Topics

#ecuador #dni #ruc #validator #cedula

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on ec_validations