diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d171549..a53a652 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,9 @@ - + + + @@ -104,41 +106,6 @@ @@ -478,11 +480,6 @@ - - - - - @@ -503,6 +500,11 @@ - \ No newline at end of file diff --git a/example/example_sheba_methods.dart b/example/example_sheba_methods.dart index 1978cc5..59575f3 100644 --- a/example/example_sheba_methods.dart +++ b/example/example_sheba_methods.dart @@ -8,7 +8,7 @@ void main() { print(bank?.persianName); // complete persian name of bank print(bank?.code); // code of bank // true means with sheba package can take account number, false means package can't - print(bank?.accountNumberAvailable); + print(bank?.isAccountNumberAvailable); print(bank?.accountNumber); // account number in simple numbers print(bank?.formattedAccountNumber); // account number with hyphen print(bank?.process); // always is null just uses in call method in Sheba @@ -18,7 +18,7 @@ void main() { name: 'Parsian Bank', persianName: 'بانک پارسیان', code: '054', - accountNumberAvailable: true, + isAccountNumberAvailable: true, accountNumber: '020817909002', formattedAccountNumber: '0020-0081790-002'); print(bank == b); diff --git a/lib/src/constants/sheba/constants.dart b/lib/src/constants/sheba/constants.dart index dc1a379..9de63de 100644 --- a/lib/src/constants/sheba/constants.dart +++ b/lib/src/constants/sheba/constants.dart @@ -6,232 +6,232 @@ var _banksInfo = [ name: 'Central Bank of Iran', persianName: 'بانک مرکزی جمهوری اسلامی ایران', code: '010', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'sanat-o-madan', name: 'Sanat O Madan Bank', persianName: 'بانک صنعت و معدن', code: '011', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'mellat', name: 'Mellat Bank', persianName: 'بانک ملت', code: '012', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'refah', name: 'Refah Bank', persianName: 'بانک رفاه کارگران', code: '013', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'maskan', name: 'Maskan Bank', persianName: 'بانک مسکن', code: '014', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'sepah', name: 'Sepah Bank', persianName: 'بانک سپه', code: '015', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'keshavarzi', name: 'Keshavarzi', persianName: 'بانک کشاورزی', code: '016', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'melli', name: 'Melli', persianName: 'بانک ملی ایران', code: '017', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'tejarat', name: 'Tejarat Bank', persianName: 'بانک تجارت', code: '018', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'saderat', name: 'Saderat Bank', persianName: 'بانک صادرات ایران', code: '019', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'tosee-saderat', name: 'Tose Saderat Bank', persianName: 'بانک توسعه صادرات', code: '020', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'post', name: 'Post Bank', persianName: 'پست بانک ایران', code: '021', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'toose-taavon', name: 'Tosee Taavon Bank', persianName: 'بانک توسعه تعاون', code: '022', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'tosee', name: 'Tosee Bank', persianName: 'موسسه اعتباری توسعه', code: '051', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'ghavamin', name: 'Ghavamin Bank', persianName: 'بانک قوامین', code: '052', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'karafarin', name: 'Karafarin Bank', persianName: 'بانک کارآفرین', code: '053', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'parsian', name: 'Parsian Bank', persianName: 'بانک پارسیان', code: '054', - accountNumberAvailable: true, + isAccountNumberAvailable: true, process: _parsianBankProc), BankInformation( nickname: 'eghtesad-novin', name: 'Eghtesad Novin Bank', persianName: 'بانک اقتصاد نوین', code: '055', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'saman', name: 'Saman Bank', persianName: 'بانک سامان', code: '056', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'pasargad', name: 'Pasargad Bank', persianName: 'بانک پاسارگاد', code: '057', - accountNumberAvailable: true, + isAccountNumberAvailable: true, process: _pasargadBankProc), BankInformation( nickname: 'sarmayeh', name: 'Sarmayeh Bank', persianName: 'بانک سرمایه', code: '058', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'sina', name: 'Sina Bank', persianName: 'بانک سینا', code: '059', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'mehr-iran', name: 'Mehr Iran Bank', persianName: 'بانک مهر ایران', code: '060', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'shahr', name: 'City Bank', persianName: 'بانک شهر', code: '061', - accountNumberAvailable: true, + isAccountNumberAvailable: true, process: _shahrBankProc), BankInformation( nickname: 'ayandeh', name: 'Ayandeh Bank', persianName: 'بانک آینده', code: '062', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'ansar', name: 'Ansar Bank', persianName: 'بانک انصار', code: '063', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'gardeshgari', name: 'Gardeshgari Bank', persianName: 'بانک گردشگری', code: '064', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'hekmat-iranian', name: 'Hekmat Iranian Bank', persianName: 'بانک حکمت ایرانیان', code: '065', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'dey', name: 'Dey Bank', persianName: 'بانک دی', code: '066', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'iran-zamin', name: 'Iran Zamin Bank', persianName: 'بانک ایران زمین', code: '069', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'resalat', name: 'Resalat Bank', persianName: 'بانک قرض الحسنه رسالت', code: '070', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'kosar', name: 'Kosar Credit Institute', persianName: 'موسسه اعتباری کوثر', code: '073', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'melal', name: 'Melal Credit Institute', persianName: 'موسسه اعتباری ملل', code: '075', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'middle-east-bank', name: 'Middle East Bank', persianName: 'بانک خاورمیانه', code: '078', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'noor-bank', name: 'Noor Credit Institution', persianName: 'موسسه اعتباری نور', code: '080', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'mehr-eqtesad', name: 'Mehr Eqtesad Bank', persianName: 'بانک مهر اقتصاد', code: '079', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'mehr-iran', name: 'Mehr Iran Bank', persianName: 'بانک مهر ایران', code: '090', - accountNumberAvailable: false), + isAccountNumberAvailable: false), BankInformation( nickname: 'iran-venezuela', name: 'Iran and Venezuela Bank', persianName: 'بانک ایران و ونزوئلا', code: '095', - accountNumberAvailable: false), + isAccountNumberAvailable: false), ]; AccountNumberModel _parsianBankProc(String string) { diff --git a/lib/src/core/sheba/methods.dart b/lib/src/core/sheba/methods.dart index dd4316b..9ce4a5a 100644 --- a/lib/src/core/sheba/methods.dart +++ b/lib/src/core/sheba/methods.dart @@ -13,7 +13,7 @@ class AccountNumberModel { /// Stores Bank information that [banksInfo] uses class BankInformation { final String nickname, name, persianName, code; - final bool accountNumberAvailable; + final bool isAccountNumberAvailable; AccountNumberModel Function(String)? process; String? accountNumber, formattedAccountNumber; @@ -22,7 +22,7 @@ class BankInformation { required this.name, required this.persianName, required this.code, - required this.accountNumberAvailable, + required this.isAccountNumberAvailable, this.process, this.accountNumber, this.formattedAccountNumber, @@ -35,7 +35,7 @@ class BankInformation { name == other.name && persianName == other.persianName && code == other.code && - accountNumberAvailable == other.accountNumberAvailable && + isAccountNumberAvailable == other.isAccountNumberAvailable && accountNumber == other.accountNumber && formattedAccountNumber == other.formattedAccountNumber && process == other.process; @@ -90,7 +90,7 @@ class Sheba { final bankCode = patternCode.firstMatch(shebaCode)?[1] ?? ''; var bank = banksInfo[bankCode]; if (bank == null) return null; - if (bank.accountNumberAvailable) { + if (bank.isAccountNumberAvailable) { final data = bank.process!(shebaCode); bank.accountNumber = data.accountNumber; bank.formattedAccountNumber = data.formattedAccountNumber; diff --git a/test/test_sheba_methods.dart b/test/test_sheba_methods.dart index 84db740..fd0916f 100644 --- a/test/test_sheba_methods.dart +++ b/test/test_sheba_methods.dart @@ -19,7 +19,7 @@ void main() { name: 'Parsian Bank', persianName: 'بانک پارسیان', code: '054', - accountNumberAvailable: true, + isAccountNumberAvailable: true, accountNumber: '020817909002', formattedAccountNumber: '0020-0081790-002'), ));