pars_validator 0.3.0
pars_validator: ^0.3.0 copied to clipboard
A lightweight Flutter library for validating Persian-specific data formats like national codes,bank card numbers, phone numbers, Shamsi dates, and more.

ParsValidator #
ParsValidator is a robust and lightweight validation library designed specifically for Persian-speaking developers building Flutter applications. It provides a suite of utilities and tools to validate Persian-specific data formats, including national codes, phone numbers, Shamsi dates, bank card numbers, and more.
✨ Features #
National ID utilities:
- Validate an Iranian National ID
- Generate a random valid Iranian National ID
- Get the issuance location of a National ID
Bank utilities:
- Validate credit card number
- Format credit card number
- Validate IBAN (Shaba)
⚙ Platform Support #
| 📱 Android | 🍎 iOS | 🍏 MacOS | 🌐 Web | 🐧 Linux | 💻 Windows |
|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
📦 Installation #
To use this package, add it to your pubspec.yaml file:
dependencies:
pars_validator: ^0.3.0
Then, run the following command to fetch the package:
flutter pub get
Import the package in your project:
import 'package:pars_validator/pars_validator.dart';
📚 Usage #
National ID #
// check national id validation
bool isValid = NationalID.isNationalIDValid("1234567890"); // false
// generate a random valid national id
String natId = NationalID.generateRandomID(); // 0714265411
// get the issuance location of a National ID
String? issuance = NationalID.getIssuance("1642459372"); // سراب
Bank #
// check card number validation
bool isValid = Banker.isCardNumberValid('1234567812345670'); // false
// format a card number
String formatted = Banker.formatCardNumber('1234567812345670'); // '1234 5678 1234 5670'
// check IBAN (Shaba) validation
bool isValid = Banker.isIBANValid('IR820540102680020817909007'); // true
🤝 Contributing #
Contributions are welcome! If you'd like to contribute, feel free to open a pull request or submit an issue.
🛡️ License #
This project is licensed under the MIT License.
📧 Contact #
For questions, feedback, or support, please reach out:
- Developer: Mohammad Taghipour
- Email: taghipourmohammad7@gmail.com