Language Change

This commit is contained in:
Nilanjan Chakrabarti
2025-07-10 13:19:31 +05:30
parent 9b439338a9
commit d4de89a91f
22 changed files with 334 additions and 227 deletions

View File

@@ -1,3 +1,5 @@
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter/material.dart';
import 'package:kmobile/api/services/auth_service.dart';
import 'package:kmobile/api/services/payment_service.dart';
@@ -45,7 +47,8 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
if (mounted) {
setState(() => _loading = false);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Failed to check TPIN status')),
SnackBar(
content: Text(AppLocalizations.of(context).tpinStatusFailed)),
);
}
}
@@ -91,7 +94,9 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
await sendTransaction();
} else {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text("Please enter a 6-digit TPIN")),
SnackBar(
content:
Text(AppLocalizations.of(context).enter6DigitTpin)),
);
}
} else {
@@ -131,12 +136,13 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
final transfer = widget.transactionData;
transfer.tpin = _pin.join();
try {
final paymentResponse = paymentService.processQuickPayWithinBank(transfer);
final paymentResponse =
paymentService.processQuickPayWithinBank(transfer);
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(paymentResponse: paymentResponse)
),
builder: (_) =>
PaymentAnimationScreen(paymentResponse: paymentResponse)),
);
} catch (e) {
if (mounted) {
@@ -157,28 +163,28 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
Navigator.pop(context);
},
),
title: const Text(
'TPIN',
title: Text(
AppLocalizations.of(context).tpin,
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
),
centerTitle: false,
),
body: Padding(
padding: const EdgeInsets.only(bottom: 20.0),
child: Column(
children: [
const Spacer(),
const Text(
'Enter Your TPIN',
style: TextStyle(fontSize: 18),
),
const SizedBox(height: 20),
_buildPinIndicators(),
const Spacer(),
_buildKeypad(),
],
),
padding: const EdgeInsets.only(bottom: 20.0),
child: Column(
children: [
const Spacer(),
Text(
AppLocalizations.of(context).enterTpin,
style: TextStyle(fontSize: 18),
),
const SizedBox(height: 20),
_buildPinIndicators(),
const Spacer(),
_buildKeypad(),
],
),
),
);
}
}