The Flutter plugin is a class library for Flutter programming using Dart language for coding. and Flutter is a framework for cross-platform development (iOS, Android, Windows Linux, Web) developed by Google.
This is my first Flutter plugin released on the pub.dev. I have written a Flutter plugin for validating and formatting Thai ID card numbers as users type. and this plugin is inspired by thai-id-validator.
Thai ID Card Numbers Validation
The Thai ID card numbers are 13 digits, constructed in the following format.
|1||This identifies the type of individual.|
|2 – 3||The Province where the holder first registered for their ID card.|
|4 – 5||The District where the holder first registered for their ID card.|
|6 – 12||For Thai nationals, this will be their birth certificate number.|
|13||A checksum calculated from digits 1-12|
Import the package into the project.
Declare the Thai ID card numbers object class.
final _thaiIdCardNumbers = ThaiIdCardNumbers();
bool isVaid = _thaiIdCardNumbers.validate("1234567890123");
String pattern = "x-xxxx-xxxxx-xx-x"; String separator = "-"; TextFormField( .... inputFormatters: [ ThaiIdCardNumbersFormatter(pattern: pattern, delimiter: separator), ], .... ),
I would like to develop a new feature is generate the Thai ID card numbers for testing or whatever you want. Coming soon…
This Flutter plugin is available to download the source code on GitHub.