Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teerasej/nextflow-dart-thai-citizen-personal-id-validator
https://github.com/teerasej/nextflow-dart-thai-citizen-personal-id-validator
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/teerasej/nextflow-dart-thai-citizen-personal-id-validator
- Owner: teerasej
- License: mit
- Created: 2020-06-06T09:51:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-26T09:00:05.000Z (over 3 years ago)
- Last Synced: 2024-04-13T19:04:48.871Z (10 months ago)
- Language: Dart
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Nextflow's Thai Personal Id checker
Thai people's personal ID has 13 digit. So I decided to create a class with validate method to check correction.
you can apply it directly to TextField's validate result, or decide to invoke `validate()` method yourself.
## Getting Started
You can use this with `TextFormField`'s `validate` property
### Using with TextFormField
```dart
ThaiIdValidator validator = ThaiIdValidator(errorMessage: 'Incorrect, Please check again');
TextFormField(
validate: validator.validate
)
```### Using in dart code
```dart
ThaiIdValidator validator = ThaiIdValidator(errorMessage: 'Incorrect, Please check again');
String errorMessage = validator.validate('thai personal id');
if(errorMessage != null) {
// personal id not pass
} else {
// go go!
}
```### Using static method
NOTE: This static method cannot be used with `TextFormField`
```dart
String errorMessage = ThaiIdValidator.validateNow(personalId: 'thai personal id', errorMessage: 'Incorrect, Please check again');
if(errorMessage != null) {
// personal id not pass
} else {
// go go!
}
```