Localization changes #4
This commit is contained in:
@@ -11,7 +11,11 @@ import 'transaction_details_screen.dart';
|
||||
class AccountStatementScreen extends StatefulWidget {
|
||||
final String accountNo;
|
||||
final String balance;
|
||||
const AccountStatementScreen({super.key, required this.accountNo, required this.balance,});
|
||||
const AccountStatementScreen({
|
||||
super.key,
|
||||
required this.accountNo,
|
||||
required this.balance,
|
||||
});
|
||||
|
||||
@override
|
||||
State<AccountStatementScreen> createState() => _AccountStatementScreen();
|
||||
@@ -167,7 +171,8 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
Text(' ₹ ${widget.balance}', style: const TextStyle(fontSize: 17)),
|
||||
Text(' ₹ ${widget.balance}',
|
||||
style: const TextStyle(fontSize: 17)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
|
@@ -46,7 +46,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
setState(() {
|
||||
accountType = AppLocalizations.of(context).savings;
|
||||
accountType = 'Savings';
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -87,13 +87,11 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
|
||||
final service = getIt<BeneficiaryService>();
|
||||
try {
|
||||
|
||||
String beneficiaryName;
|
||||
if (ifsc.toLowerCase().contains('kace')) {
|
||||
beneficiaryName = await service.validateBeneficiaryWithinBank(accountNo);
|
||||
}
|
||||
|
||||
else{
|
||||
beneficiaryName =
|
||||
await service.validateBeneficiaryWithinBank(accountNo);
|
||||
} else {
|
||||
beneficiaryName = await service.validateBeneficiary(
|
||||
accountNo: accountNo,
|
||||
ifscCode: ifsc,
|
||||
@@ -129,8 +127,9 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
// Ensure beneficiary is validated before proceeding to TPIN
|
||||
if (!_isBeneficiaryValidated) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Please validate beneficiary details first.')),
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)
|
||||
.pleaseValidateBeneficiaryDetailsFirst)),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -517,8 +516,8 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
),
|
||||
),
|
||||
items: [
|
||||
AppLocalizations.of(context).savings,
|
||||
AppLocalizations.of(context).current,
|
||||
'Savings',
|
||||
'Current',
|
||||
]
|
||||
.map(
|
||||
(type) => DropdownMenuItem(
|
||||
|
@@ -4,6 +4,8 @@ import 'package:kmobile/di/injection.dart';
|
||||
import 'package:kmobile/widgets/bank_logos.dart';
|
||||
import 'package:kmobile/api/services/beneficiary_service.dart';
|
||||
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
class BeneficiaryDetailsScreen extends StatelessWidget {
|
||||
final Beneficiary beneficiary;
|
||||
|
||||
@@ -17,7 +19,9 @@ class BeneficiaryDetailsScreen extends StatelessWidget {
|
||||
_showSuccessDialog(context);
|
||||
} catch (e) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Failed to delete beneficiary: $e')),
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'${AppLocalizations.of(context).failedToDeleteBeneficiary}: $e')),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -27,11 +31,12 @@ void _showSuccessDialog(BuildContext context) {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Success'),
|
||||
content: const Text('Beneficiary deleted successfully.'),
|
||||
title: Text(AppLocalizations.of(context).success),
|
||||
content:
|
||||
Text(AppLocalizations.of(context).beneficiaryDeletedSuccessfully),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('OK'),
|
||||
child: Text(AppLocalizations.of(context).ok),
|
||||
onPressed: () {
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
},
|
||||
@@ -47,18 +52,18 @@ void _showDeleteConfirmationDialog(BuildContext context) {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Delete Beneficiary'),
|
||||
content:
|
||||
const Text('Are you sure you want to delete this beneficiary?'),
|
||||
title: Text(AppLocalizations.of(context).deleteBeneficiary),
|
||||
content: Text(AppLocalizations.of(context)
|
||||
.areYouSureYouWantToDeleteThisBeneficiary),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('Cancel'),
|
||||
child: Text(AppLocalizations.of(context).cancel),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: const Text('Delete'),
|
||||
child: Text(AppLocalizations.of(context).delete),
|
||||
onPressed: () {
|
||||
//Navigator.of(context).pop();
|
||||
_deleteBeneficiary(context);
|
||||
@@ -68,11 +73,13 @@ void _showDeleteConfirmationDialog(BuildContext context) {
|
||||
);
|
||||
},
|
||||
);
|
||||
} @override
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Beneficiary Details'),
|
||||
title: Text(AppLocalizations.of(context).beneficiarydetails),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
@@ -95,11 +102,16 @@ void _showDeleteConfirmationDialog(BuildContext context) {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_buildDetailRow('Beneficiary Name', beneficiary.bankName ?? 'N/A'),
|
||||
_buildDetailRow('Account No.', beneficiary.accountNo),
|
||||
_buildDetailRow('Account Type', beneficiary.accountType),
|
||||
_buildDetailRow('IFSC Code', beneficiary.ifscCode),
|
||||
_buildDetailRow('Branch Name', beneficiary.branchName ?? 'N/A'),
|
||||
_buildDetailRow('${AppLocalizations.of(context).bankName} ',
|
||||
beneficiary.bankName ?? 'N/A'),
|
||||
_buildDetailRow('${AppLocalizations.of(context).accountNumber} ',
|
||||
beneficiary.accountNo),
|
||||
_buildDetailRow('${AppLocalizations.of(context).accountType} ',
|
||||
beneficiary.accountType),
|
||||
_buildDetailRow('${AppLocalizations.of(context).ifscCode} ',
|
||||
beneficiary.ifscCode),
|
||||
_buildDetailRow('${AppLocalizations.of(context).branchName} ',
|
||||
beneficiary.branchName ?? 'N/A'),
|
||||
const Spacer(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
@@ -117,7 +129,7 @@ void _showDeleteConfirmationDialog(BuildContext context) {
|
||||
_showDeleteConfirmationDialog(context);
|
||||
},
|
||||
icon: const Icon(Icons.delete),
|
||||
label: const Text('Delete'),
|
||||
label: Text(AppLocalizations.of(context).delete),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@@ -523,8 +523,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
AccountStatementScreen(
|
||||
accountNo: users[selectedAccountIndex].accountNo!,
|
||||
balance: users[selectedAccountIndex].availableBalance!,
|
||||
accountNo: users[selectedAccountIndex]
|
||||
.accountNo!,
|
||||
balance: users[selectedAccountIndex]
|
||||
.availableBalance!,
|
||||
)));
|
||||
}),
|
||||
_buildQuickLink(Symbols.checkbook,
|
||||
|
@@ -130,7 +130,8 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
||||
final neftResponse =
|
||||
await neftService.processNeftTransaction(neftTx);
|
||||
final paymentResponse = PaymentResponse(
|
||||
isSuccess: neftResponse.message.toUpperCase() == 'SUCCESS',
|
||||
isSuccess:
|
||||
neftResponse.message.toUpperCase() == 'SUCCESS',
|
||||
date: DateTime.now(),
|
||||
creditedAccount: neftTx.toAccount,
|
||||
amount: neftTx.amount,
|
||||
@@ -208,7 +209,8 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
||||
final impsResponse =
|
||||
await impsService.processImpsTransaction(impsTx);
|
||||
final paymentResponse = PaymentResponse(
|
||||
isSuccess: impsResponse.message.toUpperCase() == 'SUCCESS',
|
||||
isSuccess:
|
||||
impsResponse.message.toUpperCase() == 'SUCCESS',
|
||||
date: DateTime.now(),
|
||||
creditedAccount: impsTx.toAccount,
|
||||
amount: impsTx.amount,
|
||||
@@ -268,7 +270,8 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
||||
final rtgsResponse =
|
||||
await rtgsService.processRtgsTransaction(rtgsTx);
|
||||
final paymentResponse = PaymentResponse(
|
||||
isSuccess: rtgsResponse.message.toUpperCase() == 'SUCCESS',
|
||||
isSuccess:
|
||||
rtgsResponse.message.toUpperCase() == 'SUCCESS',
|
||||
date: DateTime.now(),
|
||||
creditedAccount: rtgsTx.toAccount,
|
||||
amount: rtgsTx.amount,
|
||||
@@ -392,7 +395,8 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
borderColor: Colors.transparent,
|
||||
selectedBorderColor: Colors.transparent,
|
||||
splashColor: Theme.of(context).primaryColor.withOpacity(0.1),
|
||||
splashColor:
|
||||
Theme.of(context).primaryColor.withOpacity(0.1),
|
||||
highlightColor:
|
||||
Theme.of(context).primaryColor.withOpacity(0.05),
|
||||
children: [
|
||||
|
@@ -22,7 +22,7 @@ class ColorThemeDialog extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const CircleAvatar(backgroundColor: Colors.green),
|
||||
title: const Text('Green'),
|
||||
title: Text(AppLocalizations.of(context).green),
|
||||
onTap: () {
|
||||
context.read<ThemeCubit>().changeTheme(ThemeType.green);
|
||||
Navigator.pop(context);
|
||||
@@ -30,7 +30,7 @@ class ColorThemeDialog extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const CircleAvatar(backgroundColor: Colors.orange),
|
||||
title: const Text('Orange'),
|
||||
title: Text(AppLocalizations.of(context).orange),
|
||||
onTap: () {
|
||||
context.read<ThemeCubit>().changeTheme(ThemeType.orange);
|
||||
Navigator.pop(context);
|
||||
|
@@ -53,7 +53,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
setState(() {
|
||||
accountType = AppLocalizations.of(context).savings;
|
||||
accountType = 'Savings';
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -572,8 +572,8 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
),
|
||||
),
|
||||
items: [
|
||||
AppLocalizations.of(context).savings,
|
||||
AppLocalizations.of(context).current,
|
||||
'Savings',
|
||||
'Current',
|
||||
]
|
||||
.map(
|
||||
(e) => DropdownMenuItem(value: e, child: Text(e)),
|
||||
|
@@ -285,5 +285,8 @@
|
||||
"areYouSureYouWantToDeleteThisBeneficiary": "Are you sure you want to delete this beneficiary?",
|
||||
"yourAccountDoesNotHaveSufficientBalance": "Your account does not have sufficient balance",
|
||||
"green": "Green",
|
||||
"orange": "Orange"
|
||||
"orange": "Orange",
|
||||
"deleteBeneficiary": "Delete Beneficiary",
|
||||
"beneficiarydetails": "Beneficiary Details",
|
||||
"delete": "Delete"
|
||||
}
|
||||
|
@@ -285,5 +285,8 @@
|
||||
"areYouSureYouWantToDeleteThisBeneficiary": "क्या आप वाकई इस लाभार्थी को हटाना चाहते हैं?",
|
||||
"yourAccountDoesNotHaveSufficientBalance": "आपके खाते में पर्याप्त शेष राशि नहीं है",
|
||||
"green": "हरा",
|
||||
"orange": "नारंगी"
|
||||
"orange": "नारंगी",
|
||||
"deleteBeneficiary": "लाभार्थी हटाएं",
|
||||
"beneficiarydetails": "लाभार्थी विवरण",
|
||||
"delete": "मिटाओ"
|
||||
}
|
||||
|
Reference in New Issue
Block a user