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

A package to easily validate and parse a Mexican CURP.

CURP #

Developed with passion by Pastel Code.

style: very good analysis


A package to easily validate and parse a Mexican CURP.

Features #

  • A Curp object can be constructed via parse or tryParse.
  • Provides a isValidString static method to check whether a string is a valid representation of a CURP.

Getting started #

To start using the package is required to import it like following:

import 'package:curp/curp.dart';

Usage #

Parse a string to a Curp object. #

const curpString = '...';
Curp.parse(curpString); // It returns a Curp object or throws a FormatException.
Curp.tryParse(curpString); // It returns a Curp object or null.

Retrieve CURP string #

After parsing a Curp object its value can be retrieved with:

final curp = Curp.parse('...');
final curpString = curp.toString();

Validate a CURP like string #

Check whether a string is a valid CURP representation.

const curpString = '...';
final isValid = Curp.isValidString(curpString); // true or false

Additional information #

For more information about CURP, head to official Mexican government website: https://www.gob.mx/curp/.

4
likes
150
points
31
downloads

Publisher

unverified uploader

Weekly Downloads

A package to easily validate and parse a Mexican CURP.

Repository (GitHub)
View/report issues

Topics

#curp #mexico #mexican #ine

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

equatable, flutter

More

Packages that depend on curp