Features
Usage
now let's look at examples and how work with apis in package
-
Adding Ordinal Suffixes - source
var number = 'سی سه';
addOrdinalSuffix(number);
number.withOrdinalSuffix
-
Removing Ordinal Suffixes - source
var number = 'چهل و سوم';
removeOrdinalSuffix(number);
number.withoutOrdinalSuffix;
-
Converting Persian words to number - source
final words = 'سه هزار دویست و دوازده';
wordsToNumber(words);
wordsToNumberString(words);
wordsToNumberString(
words,
digits: DigitLocale.fa,
addComma: true,
);
words.convertWordsToNumber();
words.convertWordsToNumberString();
-
Converting Persian numbers to word - source
final stringDigit = '257,433';
final intDigit = -128;
numberToWordsString(stringDigit);
numberToWordsString(stringDigit, ordinal: true);
numberToWords(intDigit);
numberToWords(intDigit, ordinal: true);
stringDigit.convertNumToWords();
intDigit.convertNumToWords();
-
Adding and removing separator to / from numbers - source
addCommas('3333');
addCommas('۸۲۳۳۴۵');
removeCommas('654,562');
removeCommas('3,365.255');
'11222'.addComma
'4,544.562'.removeComma
-
Converting Persian numbers to Arabic / English numbers and reverse - source
convertArToFa('السلام علیکم 14۱۲۳6٤٥');
convertArToEn('Persian Tools : 123٥٦٧');
convertEnToFa('سلام این هارو فارسی کن : 22۲۳۴');
convertFaToEn('سلام این هارو اینگلیسی کن : 22۲۳۴');
-
Checking a string has/is Persian - source
isPersian('این یک متن فارسی است؟');
isPersian('هل هذا نص فارسي؟');
hasPersian('This text includes فارسی');
hasPersian('Это персидский س текст?');
hasPersian('أكد رئيس اللجنة العسكرية الممثلة لحكومة الوفاق أراضي البلاد.');
-
Validate Iranian national ID - source
var nationalID = '0684159414';
verifyIranianNationalId(nationalID);
nationalID = '00000';
verifyIranianNationalId(nationalID);
nationalID = '';
nationalID.isIranianNationalId;
-
Find city and province name by national code - source
final place = getPlaceByIranNationalId('0084575948');
place?.city.name;
place?.province.name;
final nationalId = '2110990147';
nationalId.getPlaceNationalId?.city.name;
nationalId.getPlaceNationalId?.province.name;
var bill = Bill(billId: 9174639504124, paymentId: 12908197, currency: 'rial');
bill.barcode
bill.billType
bill.amount
bill.isBillValid
bill.isPaymentIdValid
bill.isBillIdValid
bill();
-
Checking IBAN of the bank account (SHEBA) - source
var sheba = Sheba('IR820540102680020817909002');
var bank = sheba();
bank?.nickname
bank?.name
bank?.persianName
bank?.code
bank?.isAccountNumberAvailable
bank?.accountNumber
bank?.formattedAccountNumber
bank?.process
sheba.isValid
-
Validating ATM card number - source
validateCardNumber('6219861034529007');
validateCardNumber('6219861034529007');
validateCardNumber('0000000000000000');
validateCardNumber('621986103452900');
-
Validating Iranians phone number - source
final phoneNumber = '09022002580';
phoneNumberValidator(phoneNumber);
getPhonePrefix(phoneNumber);
final operatorDetail = getPhoneNumberDetail(phoneNumber);
operatorDetail?.name;
operatorDetail?.provinces;
operatorDetail?.base;
operatorDetail?.type;
phoneNumber.isPhoneNumber;
phoneNumber.phoneNumberPrefix;
phoneNumber.phoneNumberDetail?.name;
-
Finding banks name by card number - source
final cardNumber = '6037701689095443';
final bankInfo = getBankNameFromCardNumber(cardNumber);
bankInfo?.name;
bankInfo?.initCode;
cardNumber.bankNameFromCard?.name;
-
Getting information from vehicle plate - source
var motorcyclePlate = Plate(plate: '12345678');
motorcyclePlate.info.type
motorcyclePlate.info.template
motorcyclePlate.info.province
motorcyclePlate.info.category
motorcyclePlate.isValid
var carPlate = Plate(plate: '12ب14547');
carPlate.info.type
carPlate.info.template
carPlate.info.province
carPlate.info.category
carPlate.isValid
var motorPlate = '12345678'.createVehiclePlate;
motorPlate.info.type
motorPlate.info.template
motorPlate.info.province
motorPlate.info.category
motorPlate.isValid
-
Fixing and decoding URLs - source
var url = 'wss://hostname.domain/?q=i am a wrong query';
urlFix(url);
Contributing
Thank you for your interest in contributing! For more detail about contributing, please check out the CONTRIBUTING.md file.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!