From 7f3f650f551e72143f6333e3e5db06a2aa7609c9 Mon Sep 17 00:00:00 2001 From: Payam Zahedi Date: Mon, 29 Mar 2021 14:42:22 +0430 Subject: [PATCH] improvement(PlaceByNationalId): update README.md --- .gitignore | 3 ++- README.md | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c0b724c..c60dec2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ build/ # Directory created by dartdoc doc/api/ -.idea/ \ No newline at end of file +.idea +/.idea/ diff --git a/README.md b/README.md index 39da0ef..21b673c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ - [x] [Converting Persian numbers to Arabic / English numbers and reverse](#converting-persian-numbers-to-arabic--english-numbers-and-reverse---source) - [x] [Checking a string has/is Persian](#checking-a-string-hasis-persian---source) - [x] [Validating Iranians national id](#validate-iranian-national-id---source) -- [ ] Finding city and province names by national id +- [x] [Finding city and province names by national id](#find-city-and-province-name-by-national-code---source) - [x] [Calculating bills](#calculating-bill---source) - [x] [Checking IBAN of the bank account (_SHEBA_)](#checking-iban-of-the-bank-account-sheba---source) - [x] [Validating ATM card number](#validating-atm-card-number---source) @@ -71,10 +71,24 @@ verifyIranianNationalId(nationalID); // true nationalID = '00000'; verifyIranianNationalId(nationalID); // false +/// verify nationalId with extension methods over [String] class nationalID = ''; nationalID.isIranianNationalId; // false ``` +- #### Find city and province name by national code - [source](https://github.com/persian-tools/dart-persian-tools/blob/master/lib/src/core\get_place_by_national_id\get_place_by_national_id.dart) + +```dart +final place = getPlaceByIranNationalId('0084575948'); +place?.city.name; // تهران مرکزی +place?.province.name; // تهران + +/// get place with extension methods over [String] class +final nationalId = '2110990147'; +nationalId.getPlaceNationalId?.city.name; // گرگان +nationalId.getPlaceNationalId?.province.name; // گلستان +``` + - #### Calculating Bill - [source](https://github.com/persian-tools/dart-persian-tools/blob/master/lib/src/core/bill/bill.dart) ```dart