changed imports of AppLocalization
Also added beneficiary validation while quick pay within bank
This commit is contained in:
@@ -5,14 +5,11 @@ import 'package:shimmer/shimmer.dart';
|
||||
import 'package:kmobile/data/models/transaction.dart';
|
||||
import 'package:kmobile/data/repositories/transaction_repository.dart';
|
||||
import 'package:kmobile/di/injection.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
class AccountStatementScreen extends StatefulWidget {
|
||||
final String accountNo;
|
||||
const AccountStatementScreen({
|
||||
super.key,
|
||||
required this.accountNo,
|
||||
});
|
||||
const AccountStatementScreen({super.key, required this.accountNo});
|
||||
|
||||
@override
|
||||
State<AccountStatementScreen> createState() => _AccountStatementScreen();
|
||||
@@ -45,8 +42,10 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'${AppLocalizations.of(context).failedToLoadTransactions} $e')),
|
||||
content: Text(
|
||||
'${AppLocalizations.of(context).failedToLoadTransactions} $e',
|
||||
),
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
setState(() => _txLoading = false);
|
||||
@@ -73,7 +72,8 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
if (fromDate == null) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context).pleaseSelectDateFirst)),
|
||||
content: Text(AppLocalizations.of(context).pleaseSelectDateFirst),
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).accountStatement,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -141,15 +141,21 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text("${AppLocalizations.of(context).accountNumber}: ",
|
||||
style: const TextStyle(
|
||||
fontSize: 19, fontWeight: FontWeight.bold)),
|
||||
Text(
|
||||
"${AppLocalizations.of(context).accountNumber}: ",
|
||||
style: const TextStyle(
|
||||
fontSize: 19,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Text(widget.accountNo, style: const TextStyle(fontSize: 17)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Text(AppLocalizations.of(context).filters,
|
||||
style: const TextStyle(fontSize: 17)),
|
||||
Text(
|
||||
AppLocalizations.of(context).filters,
|
||||
style: const TextStyle(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Row(
|
||||
children: [
|
||||
@@ -157,7 +163,9 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
child: GestureDetector(
|
||||
onTap: () => _selectFromDate(context),
|
||||
child: buildDateBox(
|
||||
AppLocalizations.of(context).fromDate, fromDate),
|
||||
AppLocalizations.of(context).fromDate,
|
||||
fromDate,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
@@ -165,7 +173,9 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
child: GestureDetector(
|
||||
onTap: () => _selectToDate(context),
|
||||
child: buildDateBox(
|
||||
AppLocalizations.of(context).toDate, toDate),
|
||||
AppLocalizations.of(context).toDate,
|
||||
toDate,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -178,7 +188,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
controller: _minAmountController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).minAmount,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
@@ -193,7 +203,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
controller: _maxAmountController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).maxAmount,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
@@ -241,19 +251,27 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: const CircleAvatar(
|
||||
radius: 12, backgroundColor: Colors.white),
|
||||
radius: 12,
|
||||
backgroundColor: Colors.white,
|
||||
),
|
||||
),
|
||||
title: Shimmer.fromColors(
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: Container(
|
||||
height: 10, width: 100, color: Colors.white),
|
||||
height: 10,
|
||||
width: 100,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
subtitle: Shimmer.fromColors(
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: Container(
|
||||
height: 8, width: 60, color: Colors.white),
|
||||
height: 8,
|
||||
width: 60,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -262,44 +280,37 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
child: Text(
|
||||
AppLocalizations.of(context).noTransactions,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
fontSize: 16, color: Colors.grey[600]),
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: _transactions.length,
|
||||
itemBuilder: (context, index) {
|
||||
final txn = _transactions[index];
|
||||
final isCredit = txn.type == 'CR';
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(txn.date ?? '',
|
||||
style: const TextStyle(color: Colors.grey)),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(txn.name ?? '',
|
||||
style: const TextStyle(fontSize: 16)),
|
||||
),
|
||||
Text(
|
||||
"${isCredit ? '+' : '-'}₹${txn.amount}",
|
||||
style: TextStyle(
|
||||
color: isCredit
|
||||
? Colors.green
|
||||
: Colors.red,
|
||||
// fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
],
|
||||
final tx = _transactions[index];
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
tx.type == 'CR'
|
||||
? Symbols.call_received
|
||||
: Symbols.call_made,
|
||||
color:
|
||||
tx.type == 'CR' ? Colors.green : Colors.red,
|
||||
),
|
||||
title: Text(
|
||||
tx.name != null
|
||||
? (tx.name!.length > 18
|
||||
? tx.name!.substring(0, 20)
|
||||
: tx.name!)
|
||||
: '',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
subtitle: Text(
|
||||
tx.date ?? '',
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
trailing: Text(
|
||||
"₹${tx.amount}",
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
Reference in New Issue
Block a user