formatted some files

This commit is contained in:
asif
2025-08-23 23:51:53 +05:30
parent 5f41c6e7f4
commit 59eb509dda
8 changed files with 125 additions and 116 deletions

View File

@@ -475,4 +475,3 @@ class BiometricPromptScreen extends StatelessWidget {
} }
} }
} }

View File

@@ -14,6 +14,3 @@ class RtgsResponse {
); );
} }
} }

View File

@@ -137,7 +137,7 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
} }
//IMPS transaction //IMPS transaction
else if (_selectedMode == TransactionMode.imps){ else if (_selectedMode == TransactionMode.imps) {
final impsTx = ImpsTransaction( final impsTx = ImpsTransaction(
fromAccount: widget.debitAccountNo, fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo, toAccount: widget.creditBeneficiary.accountNo,
@@ -169,16 +169,17 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
utr: impsResponse.utr, utr: impsResponse.utr,
); );
completer.complete(paymentResponse); completer.complete(paymentResponse);
} on DioException catch(e) { } on DioException catch (e) {
print('dio exception'); print('dio exception');
print(e.toString()); print(e.toString());
final error = jsonDecode(e.response.toString())['error']; final error = jsonDecode(e.response.toString())['error'];
var errorMessage = var errorMessage = {
{ "INCORRECT_TPIN": "Please Enter the correct TPIN",
"INCORRECT_TPIN" : "Please Enter the correct TPIN", "INSUFFICIENT_FUNDS":
"INSUFFICIENT_FUNDS": "Your account does not have sufficient balance" "Your account does not have sufficient balance"
}[error] ?? "Something Went Wrong"; }[error] ??
"Something Went Wrong";
final paymentResponse = PaymentResponse( final paymentResponse = PaymentResponse(
isSuccess: false, isSuccess: false,
@@ -194,8 +195,7 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
); );
completer.complete(paymentResponse); completer.complete(paymentResponse);
} }
} } else {
else {
final rtgsTx = RtgsTransaction( final rtgsTx = RtgsTransaction(
fromAccount: widget.debitAccountNo, fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo, toAccount: widget.creditBeneficiary.accountNo,
@@ -331,7 +331,6 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
_selectedMode == TransactionMode.neft, _selectedMode == TransactionMode.neft,
_selectedMode == TransactionMode.rtgs, _selectedMode == TransactionMode.rtgs,
_selectedMode == TransactionMode.imps, _selectedMode == TransactionMode.imps,
], ],
onPressed: (index) { onPressed: (index) {
setState(() { setState(() {
@@ -359,7 +358,8 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
child: Text(AppLocalizations.of(context).rtgs), child: Text(AppLocalizations.of(context).rtgs),
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0), padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).imps), child: Text(AppLocalizations.of(context).imps),
), ),
], ],

View File

@@ -265,7 +265,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
} }
} }
if(isRtgs) { if (isRtgs) {
// RTGS // RTGS
final rtgsTx = RtgsTransaction( final rtgsTx = RtgsTransaction(
fromAccount: widget.debitAccount, fromAccount: widget.debitAccount,

View File

@@ -7,50 +7,61 @@ class Branch {
final String ifsc; final String ifsc;
final String address; final String address;
Branch({required this.name, required this.code, required this.ifsc, required this.address,}); Branch({
required this.name,
required this.code,
required this.ifsc,
required this.address,
});
} }
class BranchLocatorScreen extends StatefulWidget { class BranchLocatorScreen extends StatefulWidget {
const BranchLocatorScreen({super.key}); const BranchLocatorScreen({super.key});
@override @override
State<BranchLocatorScreen> createState() => _BranchLocatorScreenState(); State<BranchLocatorScreen> createState() => _BranchLocatorScreenState();
} }
class _BranchLocatorScreenState extends State<BranchLocatorScreen> { class _BranchLocatorScreenState extends State<BranchLocatorScreen> {
final TextEditingController _searchController = TextEditingController(); final TextEditingController _searchController = TextEditingController();
// Static list of 5 branches // Static list of 5 branches
final List<Branch> _branches = [ final List<Branch> _branches = [
Branch(name: "Dharamsala - Head Office", code: "002", ifsc: "KACE0000002", address: "Civil Lines Dharmashala, Kangra, HP - 176215"), Branch(
Branch(name: "Kangra", code: "033", ifsc: "KACE0000033", address: "Rajput Bhawankangrapo Kangra, Kangra, HP "), name: "Dharamsala - Head Office",
]; code: "002",
ifsc: "KACE0000002",
address: "Civil Lines Dharmashala, Kangra, HP - 176215"),
Branch(
name: "Kangra",
code: "033",
ifsc: "KACE0000033",
address: "Rajput Bhawankangrapo Kangra, Kangra, HP "),
];
List<Branch> _filteredBranches = []; List<Branch> _filteredBranches = [];
@override
void initState() {
super.initState();
_filteredBranches = _branches; // Initially show all branches
}
void _filterBranches(String query) {
setState(() {
if (query.isEmpty) {
_filteredBranches = _branches;
} else {
_filteredBranches = _branches.where((branch) {
final lowerQuery = query.toLowerCase();
return branch.name.toLowerCase().contains(lowerQuery) ||
branch.code.toLowerCase().contains(lowerQuery) ||
branch.ifsc.toLowerCase().contains(lowerQuery) ||
branch.address.toLowerCase().contains(lowerQuery);
}).toList();
}
});
}
@override
void initState() {
super.initState();
_filteredBranches = _branches; // Initially show all branches
}
void _filterBranches(String query) {
setState(() {
if (query.isEmpty) {
_filteredBranches = _branches;
} else {
_filteredBranches = _branches.where((branch) {
final lowerQuery = query.toLowerCase();
return branch.name.toLowerCase().contains(lowerQuery) ||
branch.code.toLowerCase().contains(lowerQuery) ||
branch.ifsc.toLowerCase().contains(lowerQuery) ||
branch.address.toLowerCase().contains(lowerQuery);
}).toList();
}
});
}
// @override // @override
// Widget build(BuildContext context) { // Widget build(BuildContext context) {
@@ -91,58 +102,62 @@ branch.address.toLowerCase().contains(lowerQuery);
// } // }
// } // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context).branchLocator), title: Text(AppLocalizations.of(context).branchLocator),
), ),
body: Column( body: Column(
children: [ children: [
// Search bar // Search bar
Padding( Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: TextField( child: TextField(
controller: _searchController, controller: _searchController,
onChanged: _filterBranches, onChanged: _filterBranches,
decoration: InputDecoration( decoration: InputDecoration(
hintText: AppLocalizations.of(context).searchbranchby, hintText: AppLocalizations.of(context).searchbranchby,
prefixIcon: const Icon(Icons.search), prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
), ),
), ),
), ),
// List of branches // List of branches
Expanded( Expanded(
child: _filteredBranches.isEmpty child: _filteredBranches.isEmpty
? const Center(child: Text("No matching branches found")) ? const Center(child: Text("No matching branches found"))
: ListView.builder( : ListView.builder(
itemCount: _filteredBranches.length, itemCount: _filteredBranches.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final branch = _filteredBranches[index]; final branch = _filteredBranches[index];
return Card( return Card(
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), margin: const EdgeInsets.symmetric(
child: ListTile( horizontal: 12, vertical: 6),
leading: Icon(Icons.location_city, color: Theme.of(context).primaryColor), child: ListTile(
title: Text(branch.name, style: const TextStyle(fontWeight: FontWeight.bold)), leading: Icon(Icons.location_city,
subtitle: Text("Code: ${branch.code} | IFSC: ${branch.ifsc} \nBranch Address: ${branch.address}"), color: Theme.of(context).primaryColor),
onTap: () { title: Text(branch.name,
ScaffoldMessenger.of(context).showSnackBar( style:
SnackBar(content: Text("Selected ${branch.name}")), const TextStyle(fontWeight: FontWeight.bold)),
); subtitle: Text(
}, "Code: ${branch.code} | IFSC: ${branch.ifsc} \nBranch Address: ${branch.address}"),
), onTap: () {
); ScaffoldMessenger.of(context).showSnackBar(
}, SnackBar(
), content: Text("Selected ${branch.name}")),
), );
], },
), ),
); );
},
),
),
],
),
);
}
} }
}

View File

@@ -76,8 +76,7 @@ class _ServiceScreen extends State<ServiceScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const BranchLocatorScreen()) builder: (context) => const BranchLocatorScreen()));
);
}, },
), ),
const Divider(height: 1), const Divider(height: 1),

View File

@@ -71,8 +71,7 @@ Widget getBankLogo(String? bankName) {
width: 40, width: 40,
height: 40, height: 40,
); );
} } else {
else {
return const Icon( return const Icon(
Icons.account_balance, Icons.account_balance,
size: 40, size: 40,