From 60a5703c35c6bb11e6b7bead61c0aa4df35413ef Mon Sep 17 00:00:00 2001 From: asif Date: Wed, 20 Aug 2025 01:36:59 +0530 Subject: [PATCH] formatted the whole codebase --- lib/api/services/imps_service.dart | 2 - lib/api/services/payment_service.dart | 1 - .../screens/transaction_details_screen.dart | 22 ++- .../screens/manage_beneficiaries_screen.dart | 2 +- .../fund_transfer_beneficiary_screen.dart | 1 - lib/l10n/app_localizations.dart | 32 ++-- lib/l10n/app_localizations_en.dart | 27 ++-- lib/l10n/app_localizations_hi.dart | 30 ++-- lib/security/secure_storage.dart | 2 +- lib/widgets/bank_logos.dart | 142 +++++++++--------- 10 files changed, 138 insertions(+), 123 deletions(-) diff --git a/lib/api/services/imps_service.dart b/lib/api/services/imps_service.dart index d7df421..2491f4a 100644 --- a/lib/api/services/imps_service.dart +++ b/lib/api/services/imps_service.dart @@ -29,5 +29,3 @@ class ImpsService { } } } - - diff --git a/lib/api/services/payment_service.dart b/lib/api/services/payment_service.dart index 7b3a81d..5bca251 100644 --- a/lib/api/services/payment_service.dart +++ b/lib/api/services/payment_service.dart @@ -38,4 +38,3 @@ class PaymentService { } } } - diff --git a/lib/features/accounts/screens/transaction_details_screen.dart b/lib/features/accounts/screens/transaction_details_screen.dart index 9be0f7b..3a42b34 100644 --- a/lib/features/accounts/screens/transaction_details_screen.dart +++ b/lib/features/accounts/screens/transaction_details_screen.dart @@ -11,16 +11,16 @@ class TransactionDetailsScreen extends StatelessWidget { Widget build(BuildContext context) { final bool isCredit = transaction.type?.toUpperCase() == 'CR'; - // Future _shareScreenshot() async { - // try { - // RenderRepaintBoundary boundary = - // _shareKey.currentContext!.findRenderObject() as RenderRepaintBoundary; - // ui.Image image = await boundary.toImage(pixelRatio: 3.0); - // ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png); - // Uint8List pngBytes = byteData!.buffer.asUint8List(); - // final tempDir = await getTemporaryDirectory(); - // final file = await File('${tempDir.path}/payment_result.png').create(); - // await file.writeAsBytes(pngBytes); + // Future _shareScreenshot() async { + // try { + // RenderRepaintBoundary boundary = + // _shareKey.currentContext!.findRenderObject() as RenderRepaintBoundary; + // ui.Image image = await boundary.toImage(pixelRatio: 3.0); + // ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png); + // Uint8List pngBytes = byteData!.buffer.asUint8List(); + // final tempDir = await getTemporaryDirectory(); + // final file = await File('${tempDir.path}/payment_result.png').create(); + // await file.writeAsBytes(pngBytes); // await Share.shareXFiles( // [XFile(file.path)], @@ -165,5 +165,3 @@ class TransactionDetailsScreen extends StatelessWidget { ); } } - - diff --git a/lib/features/beneficiaries/screens/manage_beneficiaries_screen.dart b/lib/features/beneficiaries/screens/manage_beneficiaries_screen.dart index b098116..dd681d9 100644 --- a/lib/features/beneficiaries/screens/manage_beneficiaries_screen.dart +++ b/lib/features/beneficiaries/screens/manage_beneficiaries_screen.dart @@ -61,7 +61,7 @@ class _ManageBeneficiariesScreen extends State { ); } - Widget _buildBeneficiaryList() { + Widget _buildBeneficiaryList() { if (_beneficiaries.isEmpty) { return Center( child: Text(AppLocalizations.of(context).noBeneficiaryFound)); diff --git a/lib/features/fund_transfer/screens/fund_transfer_beneficiary_screen.dart b/lib/features/fund_transfer/screens/fund_transfer_beneficiary_screen.dart index fab832c..f32ba2e 100644 --- a/lib/features/fund_transfer/screens/fund_transfer_beneficiary_screen.dart +++ b/lib/features/fund_transfer/screens/fund_transfer_beneficiary_screen.dart @@ -64,7 +64,6 @@ class _FundTransferBeneficiaryScreenState ); } - Widget _buildBeneficiaryList() { if (_beneficiaries.isEmpty) { return Center( diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index d787df9..3ed7425 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -62,7 +62,8 @@ import 'app_localizations_hi.dart'; /// be consistent with the languages listed in the AppLocalizations.supportedLocales /// property. abstract class AppLocalizations { - AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + AppLocalizations(String locale) + : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; @@ -70,7 +71,8 @@ abstract class AppLocalizations { return Localizations.of(context, AppLocalizations)!; } - static const LocalizationsDelegate delegate = _AppLocalizationsDelegate(); + static const LocalizationsDelegate delegate = + _AppLocalizationsDelegate(); /// A list of this localizations delegate along with the default localizations /// delegates. @@ -82,7 +84,8 @@ abstract class AppLocalizations { /// Additional delegates can be added by appending to this list in /// MaterialApp. This list does not have to be used at all if a custom list /// of delegates is preferred or required. - static const List> localizationsDelegates = >[ + static const List> localizationsDelegates = + >[ delegate, GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, @@ -1506,7 +1509,8 @@ abstract class AppLocalizations { String get validateBeneficiaryproceeding; } -class _AppLocalizationsDelegate extends LocalizationsDelegate { +class _AppLocalizationsDelegate + extends LocalizationsDelegate { const _AppLocalizationsDelegate(); @override @@ -1515,25 +1519,25 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate } @override - bool isSupported(Locale locale) => ['en', 'hi'].contains(locale.languageCode); + bool isSupported(Locale locale) => + ['en', 'hi'].contains(locale.languageCode); @override bool shouldReload(_AppLocalizationsDelegate old) => false; } AppLocalizations lookupAppLocalizations(Locale locale) { - - // Lookup logic when only language code is specified. switch (locale.languageCode) { - case 'en': return AppLocalizationsEn(); - case 'hi': return AppLocalizationsHi(); + case 'en': + return AppLocalizationsEn(); + case 'hi': + return AppLocalizationsHi(); } throw FlutterError( - 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' - 'an issue with the localizations generation tool. Please file an issue ' - 'on GitHub with a reproducible sample app and the gen-l10n configuration ' - 'that was used.' - ); + 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.'); } diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index afab0b7..83d8401 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -486,7 +486,8 @@ class AppLocalizationsEn extends AppLocalizations { String get otpVerification => 'OTP Verification'; @override - String get otpSentMessage => 'Enter the 4-digit OTP sent to your mobile number'; + String get otpSentMessage => + 'Enter the 4-digit OTP sent to your mobile number'; @override String get verifyOtp => 'Verify OTP'; @@ -504,13 +505,15 @@ class AppLocalizationsEn extends AppLocalizations { String get tpinRequired => 'TPIN Required'; @override - String get tpinRequiredMessage => 'You need to set your TPIN to continue with secure transactions'; + String get tpinRequiredMessage => + 'You need to set your TPIN to continue with secure transactions'; @override String get setTpinTitle => 'Set TPIN'; @override - String get tpinInfo => 'Your TPIN is a 6-digit code used to authorize transactions. Keep it safe and do not share it with anyone.'; + String get tpinInfo => + 'Your TPIN is a 6-digit code used to authorize transactions. Keep it safe and do not share it with anyone.'; @override String get tpinFailed => 'Failed to set TPIN. Please try again.'; @@ -564,7 +567,8 @@ class AppLocalizationsEn extends AppLocalizations { String get enableFingerprintLogin => 'Enable Fingerprint Login?'; @override - String get enableFingerprintMessage => 'Would you like to enable fingerprint authentication for faster login?'; + String get enableFingerprintMessage => + 'Would you like to enable fingerprint authentication for faster login?'; @override String get no => 'No'; @@ -585,7 +589,8 @@ class AppLocalizationsEn extends AppLocalizations { String get loading => 'Loading......'; @override - String get enableFingerprintQuick => 'Enable fingerprint authentication for quick login?'; + String get enableFingerprintQuick => + 'Enable fingerprint authentication for quick login?'; @override String get kccb => 'KCCB'; @@ -687,13 +692,15 @@ class AppLocalizationsEn extends AppLocalizations { String get invalidRtgs => 'Invalid Amount for RTGS'; @override - String get invalidRtgsPopUp => 'RTGS transactions require a minimum amount of 200,000. Please enter a higher amount or select NEFT as the transaction mode.'; + String get invalidRtgsPopUp => + 'RTGS transactions require a minimum amount of 200,000. Please enter a higher amount or select NEFT as the transaction mode.'; @override String get correctTpin => 'Please Enter the correct TPIN'; @override - String get insufficientFund => 'Your account does not have sufficient balance'; + String get insufficientFund => + 'Your account does not have sufficient balance'; @override String get creditedTo => 'Credited To'; @@ -705,11 +712,13 @@ class AppLocalizationsEn extends AppLocalizations { String get proceed => 'Proceed'; @override - String get plsValidateBeneficiary => 'Please validate beneficiary details first'; + String get plsValidateBeneficiary => + 'Please validate beneficiary details first'; @override String get accno7to20 => 'Account number must be between 7 and 20 digits'; @override - String get validateBeneficiaryproceeding => 'Please validate beneficiary before proceeding'; + String get validateBeneficiaryproceeding => + 'Please validate beneficiary before proceeding'; } diff --git a/lib/l10n/app_localizations_hi.dart b/lib/l10n/app_localizations_hi.dart index bc0eb54..cf78143 100644 --- a/lib/l10n/app_localizations_hi.dart +++ b/lib/l10n/app_localizations_hi.dart @@ -52,7 +52,8 @@ class AppLocalizationsHi extends AppLocalizations { String get enableBiometric => 'बायोमेट्रिक प्रमाणीकरण सक्षम करें'; @override - String get useBiometricPrompt => 'तेज़ लॉगिन के लिए फिंगरप्रिंट/फेस आईडी का उपयोग करें?'; + String get useBiometricPrompt => + 'तेज़ लॉगिन के लिए फिंगरप्रिंट/फेस आईडी का उपयोग करें?'; @override String get later => 'बाद में'; @@ -486,7 +487,8 @@ class AppLocalizationsHi extends AppLocalizations { String get otpVerification => 'ओटीपी सत्यापन'; @override - String get otpSentMessage => 'अपने मोबाइल नंबर पर भेजा गया 4-अंकों का ओटीपी दर्ज करें'; + String get otpSentMessage => + 'अपने मोबाइल नंबर पर भेजा गया 4-अंकों का ओटीपी दर्ज करें'; @override String get verifyOtp => 'ओटीपी सत्यापित करें'; @@ -504,13 +506,15 @@ class AppLocalizationsHi extends AppLocalizations { String get tpinRequired => 'टी-पिन आवश्यक है'; @override - String get tpinRequiredMessage => 'सुरक्षित लेनदेन के लिए टी-पिन सेट करना आवश्यक है'; + String get tpinRequiredMessage => + 'सुरक्षित लेनदेन के लिए टी-पिन सेट करना आवश्यक है'; @override String get setTpinTitle => 'टी-पिन सेट करें'; @override - String get tpinInfo => 'आपका टी-पिन 6 अंकों का कोड है जिसका उपयोग लेन-देन को प्रमाणित करने के लिए किया जाता है। इसे सुरक्षित रखें और किसी से साझा न करें।'; + String get tpinInfo => + 'आपका टी-पिन 6 अंकों का कोड है जिसका उपयोग लेन-देन को प्रमाणित करने के लिए किया जाता है। इसे सुरक्षित रखें और किसी से साझा न करें।'; @override String get tpinFailed => 'टी-पिन सेट करने में विफल। कृपया पुनः प्रयास करें।'; @@ -564,7 +568,8 @@ class AppLocalizationsHi extends AppLocalizations { String get enableFingerprintLogin => 'फिंगरप्रिंट लॉगिन सक्षम करें?'; @override - String get enableFingerprintMessage => 'क्या आप तेज लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करना चाहेंगे?'; + String get enableFingerprintMessage => + 'क्या आप तेज लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करना चाहेंगे?'; @override String get no => 'नहीं'; @@ -573,7 +578,8 @@ class AppLocalizationsHi extends AppLocalizations { String get yes => 'हाँ'; @override - String get authenticateToEnable => 'फिंगरप्रिंट लॉगिन सक्षम करने के लिए प्रमाणीकरण करें'; + String get authenticateToEnable => + 'फिंगरप्रिंट लॉगिन सक्षम करने के लिए प्रमाणीकरण करें'; @override String get exitApp => 'ऐप बंद करें'; @@ -585,7 +591,8 @@ class AppLocalizationsHi extends AppLocalizations { String get loading => 'लोड हो रहा है......'; @override - String get enableFingerprintQuick => 'तेज़ लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करें?'; + String get enableFingerprintQuick => + 'तेज़ लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करें?'; @override String get kccb => 'केसीसीबी'; @@ -687,7 +694,8 @@ class AppLocalizationsHi extends AppLocalizations { String get invalidRtgs => 'RTGS के लिए अमान्य राशि'; @override - String get invalidRtgsPopUp => 'RTGS लेनदेन के लिए न्यूनतम 2,00,000 रुपये की राशि की आवश्यकता होती है। कृपया अधिक राशि दर्ज करें या लेनदेन मोड के रूप में NEFT चुनें'; + String get invalidRtgsPopUp => + 'RTGS लेनदेन के लिए न्यूनतम 2,00,000 रुपये की राशि की आवश्यकता होती है। कृपया अधिक राशि दर्ज करें या लेनदेन मोड के रूप में NEFT चुनें'; @override String get correctTpin => 'कृपया सही टी-पिन दर्ज करें'; @@ -705,11 +713,13 @@ class AppLocalizationsHi extends AppLocalizations { String get proceed => 'आगे बढ़ना'; @override - String get plsValidateBeneficiary => 'कृपया पहले लाभार्थी विवरण सत्यापित करें'; + String get plsValidateBeneficiary => + 'कृपया पहले लाभार्थी विवरण सत्यापित करें'; @override String get accno7to20 => 'खाता संख्या सात से बीस अंकों के बीच होनी चाहिए'; @override - String get validateBeneficiaryproceeding => 'कृपया आगे बढ़ने से पहले लाभार्थी को पट्टे पर मान्य करें'; + String get validateBeneficiaryproceeding => + 'कृपया आगे बढ़ने से पहले लाभार्थी को पट्टे पर मान्य करें'; } diff --git a/lib/security/secure_storage.dart b/lib/security/secure_storage.dart index 55dc66a..7183790 100644 --- a/lib/security/secure_storage.dart +++ b/lib/security/secure_storage.dart @@ -29,4 +29,4 @@ class SecureStorage { Future deleteAll() async { await _storage.deleteAll(); } -} \ No newline at end of file +} diff --git a/lib/widgets/bank_logos.dart b/lib/widgets/bank_logos.dart index 366562e..8c99a17 100644 --- a/lib/widgets/bank_logos.dart +++ b/lib/widgets/bank_logos.dart @@ -1,76 +1,74 @@ import 'package:flutter/material.dart'; Widget getBankLogo(String? bankName) { - if (bankName != null && bankName.toLowerCase().contains('state bank of')) { - return Image.asset( - 'assets/images/sbi_logo.png', - width: 40, - height: 40, - ); - } - if (bankName != null && bankName.toLowerCase().contains('kangra central')) { - return Image.asset( - 'assets/images/icon.png', - width: 40, - height: 40, - ); - } - if (bankName != null && bankName.toLowerCase().contains('hdfc bank ltd')) { - return Image.asset( - 'assets/images/hdfc_logo.png', - width: 40, - height: 40, - ); - } - if (bankName != null && bankName.toLowerCase().contains('icici bank ltd')) { - return Image.asset( - 'assets/images/icici_logo.png', - width: 40, - height: 40, - ); - } - if (bankName != null && - bankName.toLowerCase().contains('punjab national bank')) { - return Image.asset( - 'assets/images/pnb_logo.png', - width: 40, - height: 40, - ); - } - if (bankName != null && bankName.toLowerCase().contains('axis')) { - return Image.asset( - 'assets/images/axisBank_logo.png', - width: 40, - height: 40, - ); - } - if (bankName != null && bankName.toLowerCase().contains('baroda')) { - return Image.asset( - 'assets/images/bankofBaroda_logo.png', - width: 40, - height: 40, - ); - } - if (bankName != null && bankName.toLowerCase().contains('canara bank')) { - return Image.asset( - 'assets/images/canaraBank_logo.png', - width: 40, - height: 40, - ); - } - if (bankName != null && bankName.toLowerCase().contains('kotak')) { - return Image.asset( - 'assets/images/kotak_logo.png', - width: 40, - height: 40, - ); - } - else { - return const Icon( - Icons.account_balance, - size: 40, - color: Colors.grey, - ); - } + if (bankName != null && bankName.toLowerCase().contains('state bank of')) { + return Image.asset( + 'assets/images/sbi_logo.png', + width: 40, + height: 40, + ); } - + if (bankName != null && bankName.toLowerCase().contains('kangra central')) { + return Image.asset( + 'assets/images/icon.png', + width: 40, + height: 40, + ); + } + if (bankName != null && bankName.toLowerCase().contains('hdfc bank ltd')) { + return Image.asset( + 'assets/images/hdfc_logo.png', + width: 40, + height: 40, + ); + } + if (bankName != null && bankName.toLowerCase().contains('icici bank ltd')) { + return Image.asset( + 'assets/images/icici_logo.png', + width: 40, + height: 40, + ); + } + if (bankName != null && + bankName.toLowerCase().contains('punjab national bank')) { + return Image.asset( + 'assets/images/pnb_logo.png', + width: 40, + height: 40, + ); + } + if (bankName != null && bankName.toLowerCase().contains('axis')) { + return Image.asset( + 'assets/images/axisBank_logo.png', + width: 40, + height: 40, + ); + } + if (bankName != null && bankName.toLowerCase().contains('baroda')) { + return Image.asset( + 'assets/images/bankofBaroda_logo.png', + width: 40, + height: 40, + ); + } + if (bankName != null && bankName.toLowerCase().contains('canara bank')) { + return Image.asset( + 'assets/images/canaraBank_logo.png', + width: 40, + height: 40, + ); + } + if (bankName != null && bankName.toLowerCase().contains('kotak')) { + return Image.asset( + 'assets/images/kotak_logo.png', + width: 40, + height: 40, + ); + } else { + return const Icon( + Icons.account_balance, + size: 40, + color: Colors.grey, + ); + } +}