Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
1204507375 | |||
be9a6fc93f | |||
b8337d1152 | |||
d3792a1a06 |
@@ -1,5 +1,6 @@
|
||||
import 'dart:developer';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:kmobile/core/errors/exceptions.dart';
|
||||
import 'package:kmobile/data/models/ifsc.dart';
|
||||
import 'package:kmobile/data/models/beneficiary.dart';
|
||||
|
||||
@@ -40,8 +41,12 @@ class BeneficiaryService {
|
||||
if (e.response?.statusCode == 404) {
|
||||
throw Exception('INVALID IFSC CODE');
|
||||
}
|
||||
else if (e.response?.statusCode == 401) {
|
||||
throw Exception('INVALID IFSC CODE');
|
||||
}
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
throw UnexpectedException(
|
||||
'Unexpected error during login: ${e.toString()}');
|
||||
}
|
||||
return Ifsc.fromJson({});
|
||||
}
|
||||
@@ -118,4 +123,4 @@ class BeneficiaryService {
|
||||
throw Exception('Unexpected error: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -342,10 +342,10 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
currentIndex: _selectedIndex,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
selectedItemColor: Theme.of(context).colorScheme.primary,
|
||||
backgroundColor: const Color(0XFF1E58AD),
|
||||
selectedItemColor: Theme.of(context).colorScheme.onPrimary,
|
||||
unselectedItemColor:
|
||||
Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
|
||||
Theme.of(context).colorScheme.onSecondary,
|
||||
onTap: (index) {
|
||||
setState(() {
|
||||
_selectedIndex = index;
|
||||
|
@@ -23,7 +23,9 @@ class AddBeneficiaryScreen extends StatefulWidget {
|
||||
|
||||
class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
final _accountNumberFieldKey = GlobalKey<FormFieldState>();
|
||||
final _confirmAccountNumberFieldKey = GlobalKey<FormFieldState>();
|
||||
final _ifscFieldKey = GlobalKey<FormFieldState>();
|
||||
final TextEditingController accountNumberController = TextEditingController();
|
||||
final TextEditingController confirmAccountNumberController =
|
||||
TextEditingController();
|
||||
@@ -237,6 +239,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
key: _accountNumberFieldKey,
|
||||
controller: accountNumberController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(
|
||||
@@ -267,6 +270,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
const SizedBox(height: 24),
|
||||
// Confirm Account Number
|
||||
TextFormField(
|
||||
key: _confirmAccountNumberFieldKey,
|
||||
controller: confirmAccountNumberController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(
|
||||
@@ -285,15 +289,14 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
).reenterAccountNumber;
|
||||
}
|
||||
if (value != accountNumberController.text) {
|
||||
return AppLocalizations.of(
|
||||
context,
|
||||
).accountMismatch;
|
||||
return AppLocalizations.of(context,).accountMismatch;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
TextFormField(
|
||||
key: _ifscFieldKey,
|
||||
controller: ifscController,
|
||||
maxLength: 11,
|
||||
inputFormatters: [
|
||||
@@ -390,20 +393,20 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _isValidating
|
||||
? null
|
||||
: () {
|
||||
if (confirmAccountNumberController
|
||||
.text ==
|
||||
accountNumberController.text) {
|
||||
_validateBeneficiary();
|
||||
} else {
|
||||
setState(() {
|
||||
_validationError =
|
||||
'Please enter a valid and matching account number.';
|
||||
});
|
||||
}
|
||||
},
|
||||
onPressed: _isValidating
|
||||
? null
|
||||
: () {
|
||||
final isAccountValid =
|
||||
_accountNumberFieldKey.currentState!.validate();
|
||||
final isConfirmAccountValid =
|
||||
_confirmAccountNumberFieldKey.currentState!.validate();
|
||||
final isIfscValid = _ifscFieldKey.currentState!.validate();
|
||||
|
||||
if (isAccountValid && isConfirmAccountValid && isIfscValid) {
|
||||
_validateBeneficiary();
|
||||
}
|
||||
},
|
||||
|
||||
child: _isValidating
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
|
@@ -1,3 +1,5 @@
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/features/card/screens/block_card_screen.dart';
|
||||
import 'package:kmobile/features/card/screens/card_details_screen.dart';
|
||||
@@ -35,12 +37,12 @@ class _CardManagementScreen extends State<CardManagementScreen> {
|
||||
icon: Symbols.remove_moderator,
|
||||
label: AppLocalizations.of(context).blockUnblockCard,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const BlockCardScreen(),
|
||||
),
|
||||
);
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => const BlockCardScreen(),
|
||||
// ),
|
||||
// );
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
@@ -61,12 +63,12 @@ class _CardManagementScreen extends State<CardManagementScreen> {
|
||||
icon: Symbols.payment_card,
|
||||
label: AppLocalizations.of(context).viewCardDeatils,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const CardDetailsScreen(),
|
||||
),
|
||||
);
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => const CardDetailsScreen(),
|
||||
// ),
|
||||
// );
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
|
@@ -289,7 +289,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
vertical: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primary,
|
||||
color: Color(0xFF01A04C),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Column(
|
||||
|
@@ -86,7 +86,6 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
|
||||
final String accountNo = accountNumberController.text.trim();
|
||||
final String ifsc = ifscController.text.trim();
|
||||
// ignore: prefer_const_declarations
|
||||
final String remitter = "Unknown";
|
||||
|
||||
final service = getIt<BeneficiaryService>();
|
||||
|
@@ -25,7 +25,7 @@ class BranchLocatorScreen extends StatefulWidget {
|
||||
class _BranchLocatorScreenState extends State<BranchLocatorScreen> {
|
||||
final TextEditingController _searchController = TextEditingController();
|
||||
|
||||
// Static list of 5 branches
|
||||
// Static list of 2 branches
|
||||
final List<Branch> _branches = [
|
||||
Branch(
|
||||
name: "Dharamsala - Head Office",
|
||||
@@ -36,7 +36,7 @@ class _BranchLocatorScreenState extends State<BranchLocatorScreen> {
|
||||
name: "Kangra",
|
||||
code: "033",
|
||||
ifsc: "KACE0000033",
|
||||
address: "Rajput Bhawankangrapo Kangra, Kangra, HP "),
|
||||
address: "Rajput Bhawankangrapo, Kangra, HP "),
|
||||
];
|
||||
|
||||
List<Branch> _filteredBranches = [];
|
||||
@@ -63,45 +63,6 @@ class _BranchLocatorScreenState extends State<BranchLocatorScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// title: Text(AppLocalizations.of(context).branchLocator),
|
||||
// ),
|
||||
// body: Center(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Icon(
|
||||
// Icons.location_on,
|
||||
// size: 80,
|
||||
// color: Theme.of(context).primaryColor,
|
||||
// ),
|
||||
// const SizedBox(height: 16),
|
||||
// Text(
|
||||
// AppLocalizations.of(context).findnearbybranched,
|
||||
// style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
// ),
|
||||
// const SizedBox(height: 24),
|
||||
// ElevatedButton.icon(
|
||||
// icon: const Icon(Icons.search),
|
||||
// label: Text( AppLocalizations.of(context).searchbranch),
|
||||
// onPressed: () {
|
||||
// // Place API here
|
||||
|
||||
// // ScaffoldMessenger.of(context).showSnackBar(
|
||||
// // SnackBar(content: Text( AppLocalizations.of(context).branchsearchsoon)),
|
||||
// // );
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -139,7 +100,7 @@ class _BranchLocatorScreenState extends State<BranchLocatorScreen> {
|
||||
horizontal: 12, vertical: 6),
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.location_city,
|
||||
color: Theme.of(context).primaryColor),
|
||||
color: Theme.of(context).colorScheme.primary),
|
||||
title: Text(branch.name,
|
||||
style:
|
||||
const TextStyle(fontWeight: FontWeight.bold)),
|
||||
|
@@ -16,14 +16,18 @@ void main() async {
|
||||
|
||||
// Check for device compromise
|
||||
final compromisedMessage = await SecurityService.deviceCompromisedMessage;
|
||||
// if (compromisedMessage != null) {
|
||||
// runApp(MaterialApp(
|
||||
// home: SecurityErrorScreen(message: compromisedMessage),
|
||||
// ));
|
||||
// return;
|
||||
// }
|
||||
if (compromisedMessage != null) {
|
||||
runApp(MaterialApp(
|
||||
home: SecurityErrorScreen(message: compromisedMessage),
|
||||
));
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize dependencies
|
||||
await setupDependencies();
|
||||
runApp(const KMobile());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -60,6 +60,8 @@ dependencies:
|
||||
lottie: ^2.6.0
|
||||
share_plus: ^7.2.1
|
||||
confetti: ^0.7.0
|
||||
# jailbreak_root_detection: "^1.1.6"
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user