Watermark added, Card commented out and account opening commented out

This commit is contained in:
2025-11-12 15:59:41 +05:30
parent ef481ec879
commit 39165d631e
41 changed files with 3441 additions and 2661 deletions

View File

@@ -316,7 +316,7 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
int _selectedIndex = 0; int _selectedIndex = 0;
final List<Widget> _pages = [ final List<Widget> _pages = [
const DashboardScreen(), const DashboardScreen(),
const CardManagementScreen(), // const CardManagementScreen(),
const ServiceScreen(), const ServiceScreen(),
]; ];
@@ -374,10 +374,10 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
icon: const Icon(Icons.home_filled), icon: const Icon(Icons.home_filled),
label: AppLocalizations.of(context).home, label: AppLocalizations.of(context).home,
), ),
BottomNavigationBarItem( // BottomNavigationBarItem(
icon: const Icon(Icons.credit_card), // icon: const Icon(Icons.credit_card),
label: AppLocalizations.of(context).card, // label: AppLocalizations.of(context).card,
), // ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: const Icon(Icons.miscellaneous_services), icon: const Icon(Icons.miscellaneous_services),
label: AppLocalizations.of(context).services, label: AppLocalizations.of(context).services,

View File

@@ -1,4 +1,3 @@
class Beneficiary { class Beneficiary {
final String accountNo; final String accountNo;
final String accountType; final String accountType;

View File

@@ -69,9 +69,9 @@ Dio _createDioClient() {
final dio = Dio( final dio = Dio(
BaseOptions( BaseOptions(
baseUrl: baseUrl:
//'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', //test 'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', //test
//'http://lb-kccb-mobile-banking-app-848675342.ap-south-1.elb.amazonaws.com', //prod //'http://lb-kccb-mobile-banking-app-848675342.ap-south-1.elb.amazonaws.com', //prod
'https://kccbmbnk.net', //prod small //'https://kccbmbnk.net', //prod small
connectTimeout: const Duration(seconds: 60), connectTimeout: const Duration(seconds: 60),
receiveTimeout: const Duration(seconds: 60), receiveTimeout: const Duration(seconds: 60),
headers: { headers: {

View File

@@ -34,59 +34,76 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
.accountInfo .accountInfo
.replaceFirst(RegExp('\n'), '')), .replaceFirst(RegExp('\n'), '')),
), ),
body: ListView( body: Stack(
padding: const EdgeInsets.all(16.0),
children: [ children: [
Text( ListView(
AppLocalizations.of(context).accountNumber, padding: const EdgeInsets.all(16.0),
style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 14), children: [
), Text(
AppLocalizations.of(context).accountNumber,
style:
const TextStyle(fontWeight: FontWeight.w500, fontSize: 14),
),
DropdownButton<User>( DropdownButton<User>(
value: selectedUser, value: selectedUser,
onChanged: (User? newUser) { onChanged: (User? newUser) {
if (newUser != null) { if (newUser != null) {
setState(() { setState(() {
selectedUser = newUser; selectedUser = newUser;
}); });
} }
}, },
items: widget.users.map((user) { items: widget.users.map((user) {
return DropdownMenuItem<User>( return DropdownMenuItem<User>(
value: user, value: user,
child: Text(user.accountNo.toString()), child: Text(user.accountNo.toString()),
); );
}).toList(), }).toList(),
), ),
InfoRow( InfoRow(
title: AppLocalizations.of(context).customerNumber, title: AppLocalizations.of(context).customerNumber,
value: selectedUser.cifNumber ?? 'N/A', value: selectedUser.cifNumber ?? 'N/A',
), ),
InfoRow( InfoRow(
title: AppLocalizations.of(context).productName, title: AppLocalizations.of(context).productName,
value: selectedUser.productType ?? 'N/A', value: selectedUser.productType ?? 'N/A',
), ),
// InfoRow(title: 'Account Opening Date', value: users[selectedIndex].accountOpeningDate ?? 'N/A'), // InfoRow(title: 'Account Opening Date', value: users[selectedIndex].accountOpeningDate ?? 'N/A'),
InfoRow( InfoRow(
title: AppLocalizations.of(context).accountStatus, title: AppLocalizations.of(context).accountStatus,
value: 'OPEN', value: 'OPEN',
), ),
InfoRow( InfoRow(
title: AppLocalizations.of(context).availableBalance, title: AppLocalizations.of(context).availableBalance,
value: selectedUser.availableBalance ?? 'N/A', value: selectedUser.availableBalance ?? 'N/A',
), ),
InfoRow( InfoRow(
title: AppLocalizations.of(context).currentBalance, title: AppLocalizations.of(context).currentBalance,
value: selectedUser.currentBalance ?? 'N/A', value: selectedUser.currentBalance ?? 'N/A',
), ),
users[selectedIndex].approvedAmount != null users[selectedIndex].approvedAmount != null
? InfoRow( ? InfoRow(
title: AppLocalizations.of(context).approvedAmount, title: AppLocalizations.of(context).approvedAmount,
value: selectedUser.approvedAmount ?? 'N/A', value: selectedUser.approvedAmount ?? 'N/A',
) )
: const SizedBox.shrink(), : const SizedBox.shrink(),
],
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
], ],
), ),
); );

View File

@@ -133,201 +133,223 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: Padding( body: Stack(
padding: const EdgeInsets.all(12.0), children: [
child: Column( Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.all(12.0),
children: [ child: Column(
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
"${AppLocalizations.of(context).accountNumber}: ", children: [
style: const TextStyle( Text(
fontSize: 17, "${AppLocalizations.of(context).accountNumber}: ",
fontWeight: FontWeight.bold, style: const TextStyle(
), fontSize: 17,
), fontWeight: FontWeight.bold,
Text(widget.accountNo, style: const TextStyle(fontSize: 17)), ),
],
),
const SizedBox(height: 15),
Row(
children: [
Text(
"${AppLocalizations.of(context).availableBalance}: ",
style: const TextStyle(
fontSize: 17,
),
),
Text('${widget.balance}',
style: const TextStyle(fontSize: 17)),
],
),
const SizedBox(height: 15),
Text(
AppLocalizations.of(context).filters,
style: const TextStyle(fontSize: 17),
),
const SizedBox(height: 15),
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () => _selectFromDate(context),
child: buildDateBox(
AppLocalizations.of(context).fromDate,
fromDate,
), ),
), Text(widget.accountNo,
style: const TextStyle(fontSize: 17)),
],
), ),
const SizedBox(width: 10), const SizedBox(height: 15),
Expanded( Row(
child: GestureDetector( children: [
onTap: () => _selectToDate(context), Text(
child: buildDateBox( "${AppLocalizations.of(context).availableBalance}: ",
AppLocalizations.of(context).toDate, style: const TextStyle(
toDate, fontSize: 17,
),
), ),
), Text('${widget.balance}',
style: const TextStyle(fontSize: 17)),
],
), ),
], const SizedBox(height: 15),
), Text(
const SizedBox(height: 20), AppLocalizations.of(context).filters,
SizedBox( style: const TextStyle(fontSize: 17),
width: double.infinity,
child: ElevatedButton(
onPressed: _loadTransactions,
style: ElevatedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
padding: const EdgeInsets.symmetric(vertical: 16),
), ),
child: Text( const SizedBox(height: 15),
AppLocalizations.of(context).search, Row(
style: TextStyle( children: [
color: Theme.of(context).colorScheme.onPrimaryContainer, Expanded(
fontSize: 16, child: GestureDetector(
), onTap: () => _selectFromDate(context),
), child: buildDateBox(
), AppLocalizations.of(context).fromDate,
), fromDate,
const SizedBox(height: 15),
if (!_txLoading &&
_transactions.isNotEmpty &&
fromDate == null &&
toDate == null)
Padding(
padding: const EdgeInsets.only(bottom: 12.0),
child: Text(
AppLocalizations.of(context).lastTenTransactions,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
),
Expanded(
child: _txLoading
? ListView.builder(
itemCount: 3,
itemBuilder: (_, __) => ListTile(
leading: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: CircleAvatar(
radius: 12,
backgroundColor:
Theme.of(context).scaffoldBackgroundColor,
),
),
title: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: 10,
width: 100,
color: Theme.of(context).scaffoldBackgroundColor,
),
),
subtitle: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: 8,
width: 60,
color: Theme.of(context).scaffoldBackgroundColor,
),
), ),
), ),
) ),
: _transactions.isEmpty const SizedBox(width: 10),
? Center( Expanded(
child: Text( child: GestureDetector(
AppLocalizations.of(context).noTransactions, onTap: () => _selectToDate(context),
style: TextStyle( child: buildDateBox(
fontSize: 16, AppLocalizations.of(context).toDate,
color: Theme.of(context).colorScheme.onSurface, toDate,
)), ),
),
),
],
),
const SizedBox(height: 20),
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _loadTransactions,
style: ElevatedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
padding: const EdgeInsets.symmetric(vertical: 16),
),
child: Text(
AppLocalizations.of(context).search,
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimaryContainer,
fontSize: 16,
),
),
),
),
const SizedBox(height: 15),
if (!_txLoading &&
_transactions.isNotEmpty &&
fromDate == null &&
toDate == null)
Padding(
padding: const EdgeInsets.only(bottom: 12.0),
child: Text(
AppLocalizations.of(context).lastTenTransactions,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
),
Expanded(
child: _txLoading
? ListView.builder(
itemCount: 3,
itemBuilder: (_, __) => ListTile(
leading: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: CircleAvatar(
radius: 12,
backgroundColor:
Theme.of(context).scaffoldBackgroundColor,
),
),
title: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: 10,
width: 100,
color:
Theme.of(context).scaffoldBackgroundColor,
),
),
subtitle: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: 8,
width: 60,
color:
Theme.of(context).scaffoldBackgroundColor,
),
),
),
) )
: ListView.separated( : _transactions.isEmpty
itemCount: _transactions.length, ? Center(
itemBuilder: (context, index) { child: Text(
final tx = _transactions[index]; AppLocalizations.of(context).noTransactions,
return ListTile( style: TextStyle(
leading: Icon( fontSize: 16,
tx.type == 'CR' color:
? Symbols.call_received Theme.of(context).colorScheme.onSurface,
: Symbols.call_made, )),
color: tx.type == 'CR' )
? Colors.green : ListView.separated(
: Theme.of(context).colorScheme.error, itemCount: _transactions.length,
), itemBuilder: (context, index) {
title: Text( final tx = _transactions[index];
tx.date ?? '', return ListTile(
style: const TextStyle(fontSize: 15), leading: Icon(
), tx.type == 'CR'
subtitle: Text( ? Symbols.call_received
tx.name != null : Symbols.call_made,
? (tx.name!.length > 22 color: tx.type == 'CR'
? tx.name!.substring(0, 22) ? Colors.green
: tx.name!) : Theme.of(context).colorScheme.error,
: '',
style: const TextStyle(fontSize: 12),
),
trailing: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"${tx.amount}",
style: const TextStyle(fontSize: 17),
), ),
Text( title: Text(
"Bal: ₹${tx.balance}", tx.date ?? '',
style: const TextStyle( style: const TextStyle(fontSize: 15),
fontSize: 12), // Style matches tx.name
), ),
], subtitle: Text(
), tx.name != null
onTap: () { ? (tx.name!.length > 22
Navigator.push( ? tx.name!.substring(0, 22)
context, : tx.name!)
MaterialPageRoute( : '',
builder: (_) => TransactionDetailsScreen( style: const TextStyle(fontSize: 12),
transaction: tx),
), ),
trailing: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"${tx.amount}",
style: const TextStyle(fontSize: 17),
),
Text(
"Bal: ₹${tx.balance}",
style: const TextStyle(
fontSize:
12), // Style matches tx.name
),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) =>
TransactionDetailsScreen(
transaction: tx),
),
);
},
); );
}, },
); separatorBuilder: (context, index) {
}, return const Divider();
separatorBuilder: (context, index) { },
return const Divider(); ),
}, ),
), ],
), ),
], ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
onPressed: () { onPressed: () {

View File

@@ -14,72 +14,91 @@ class TransactionDetailsScreen extends StatelessWidget {
return Scaffold( return Scaffold(
appBar: appBar:
AppBar(title: Text(AppLocalizations.of(context).transactionDetails)), AppBar(title: Text(AppLocalizations.of(context).transactionDetails)),
body: Padding( body: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: Column( Padding(
children: [ padding: const EdgeInsets.all(16.0),
Expanded( child: Column(
flex: 3, children: [
child: Center( Expanded(
child: Column( flex: 3,
mainAxisSize: MainAxisSize.min, child: Center(
children: [ child: Column(
// Amount + icon + Share Button
Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( // Amount + icon + Share Button
"${transaction.amount}", Row(
style: const TextStyle( mainAxisSize: MainAxisSize.min,
fontSize: 40, children: [
fontWeight: FontWeight.bold, Text(
), "${transaction.amount}",
style: const TextStyle(
fontSize: 40,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 8),
Icon(
isCredit
? Symbols.call_received
: Symbols.call_made,
color: isCredit ? Colors.green : Colors.red,
size: 28,
),
],
), ),
const SizedBox(width: 8), const SizedBox(height: 8),
Icon( // Date centered
isCredit ? Symbols.call_received : Symbols.call_made, Text(
color: isCredit ? Colors.green : Colors.red, transaction.date ?? "",
size: 28, style: const TextStyle(
fontSize: 16,
color: Colors.grey,
),
textAlign: TextAlign.center,
), ),
], ],
), ),
const SizedBox(height: 8), ),
// Date centered ),
Text( const Divider(),
transaction.date ?? "", Expanded(
style: const TextStyle( flex: 5,
fontSize: 16, child: ListView(
color: Colors.grey, children: [
), _buildDetailRow(
textAlign: TextAlign.center, AppLocalizations.of(context).transactionType,
), transaction.type ?? ""),
], _buildDetailRow(AppLocalizations.of(context).transferType,
transaction.name.split("/").first ?? ""),
// if (transaction.name.length > 12) ...[
// _buildDetailRow(AppLocalizations.of(context).utrNo,
// transaction.name.split("= ")[1].split(" ")[0] ?? ""),
// _buildDetailRow(
// AppLocalizations.of(context).beneficiaryAccountNo,
// transaction.name.split("A/C ").last ?? "")
// ]
_buildDetailRow(AppLocalizations.of(context).details,
transaction.name),
],
),
),
],
),
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
), ),
), ),
), ),
const Divider(), ),
Expanded( ],
flex: 5,
child: ListView(
children: [
_buildDetailRow(AppLocalizations.of(context).transactionType,
transaction.type ?? ""),
_buildDetailRow(AppLocalizations.of(context).transferType,
transaction.name.split("/").first ?? ""),
// if (transaction.name.length > 12) ...[
// _buildDetailRow(AppLocalizations.of(context).utrNo,
// transaction.name.split("= ")[1].split(" ")[0] ?? ""),
// _buildDetailRow(
// AppLocalizations.of(context).beneficiaryAccountNo,
// transaction.name.split("A/C ").last ?? "")
// ]
_buildDetailRow(
AppLocalizations.of(context).details, transaction.name),
],
),
),
],
),
), ),
); );
} }

View File

@@ -12,28 +12,44 @@ class TncRequiredScreen extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
title: const Text('Terms and Conditions'), title: const Text('Terms and Conditions'),
), ),
body: Center( body: Stack(
child: Padding( children: [
padding: const EdgeInsets.all(16.0), Center(
child: Column( child: Padding(
mainAxisAlignment: MainAxisAlignment.center, padding: const EdgeInsets.all(16.0),
children: [ child: Column(
const Text( mainAxisAlignment: MainAxisAlignment.center,
'You must accept the Terms and Conditions to use the application.', children: [
textAlign: TextAlign.center, const Text(
style: TextStyle(fontSize: 18), 'You must accept the Terms and Conditions to use the application.',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
// This will take the user back to the previous screen
Navigator.of(context).pop();
},
child: const Text('Go Back'),
),
],
), ),
const SizedBox(height: 20), ),
ElevatedButton(
onPressed: () {
// This will take the user back to the previous screen
Navigator.of(context).pop();
},
child: const Text('Go Back'),
),
],
), ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
); );
} }

View File

@@ -264,278 +264,304 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
centerTitle: false, centerTitle: false,
), ),
body: SafeArea( body: SafeArea(
child: Form( child: Stack(
key: _formKey, children: [
child: Column( Form(
children: [ key: _formKey,
Expanded( child: Column(
child: SingleChildScrollView( children: [
physics: const AlwaysScrollableScrollPhysics(), Expanded(
child: Padding( child: SingleChildScrollView(
padding: const EdgeInsets.all(10.0), physics: const AlwaysScrollableScrollPhysics(),
child: Column( child: Padding(
children: [ padding: const EdgeInsets.all(10.0),
TextFormField( child: Column(
key: _accountNumberFieldKey, children: [
controller: accountNumberController, TextFormField(
decoration: InputDecoration( key: _accountNumberFieldKey,
labelText: AppLocalizations.of( controller: accountNumberController,
context, decoration: InputDecoration(
).accountNumber, labelText: AppLocalizations.of(
// prefixIcon: Icon(Icons.person), context,
border: const OutlineInputBorder(), ).accountNumber,
isDense: true, // prefixIcon: Icon(Icons.person),
), border: const OutlineInputBorder(),
obscureText: true, isDense: true,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onChanged: (value) {
nameController.clear();
setState(() {
_isBeneficiaryValidated = false;
});
},
validator: (value) {
if (value == null || value.length < 10) {
return AppLocalizations.of(
context,
).enterValidAccountNumber;
}
return null;
},
),
const SizedBox(height: 24),
// Confirm Account Number
TextFormField(
key: _confirmAccountNumberFieldKey,
controller: confirmAccountNumberController,
decoration: InputDecoration(
labelText: AppLocalizations.of(
context,
).confirmAccountNumber,
// prefixIcon: Icon(Icons.person),
border: const OutlineInputBorder(),
isDense: true,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(
context,
).reenterAccountNumber;
}
if (value != accountNumberController.text) {
return AppLocalizations.of(
context,
).accountMismatch;
}
return null;
},
),
const SizedBox(height: 24),
TextFormField(
focusNode: _ifscFocusNode,
key: _ifscFieldKey,
controller: ifscController,
maxLength: 11,
inputFormatters: [
LengthLimitingTextInputFormatter(11),
],
decoration: InputDecoration(
labelText: AppLocalizations.of(context).ifscCode,
border: const OutlineInputBorder(),
isDense: true,
),
textCapitalization: TextCapitalization.characters,
textInputAction: TextInputAction.next,
onChanged: (value) {
setState(() {
final trimmed = value.trim().toUpperCase();
if (trimmed.length < 11) {
// clear bank/branch if backspace or changed
bankNameController.clear();
branchNameController.clear();
}
});
},
validator: (value) {
final pattern = RegExp(r'^[A-Z]{4}0[A-Z0-9]{6}$');
if (value == null || value.trim().isEmpty) {
return AppLocalizations.of(context).enterIfsc;
} else if (!pattern.hasMatch(
value.trim().toUpperCase(),
)) {
return AppLocalizations.of(
context,
).invalidIfscFormat;
}
return null;
},
),
const SizedBox(height: 24),
// Bank Name (Disabled)
TextFormField(
controller: bankNameController,
enabled: false, // changed from readOnly to disabled
decoration: InputDecoration(
labelText: AppLocalizations.of(context).bankName,
border: const OutlineInputBorder(),
isDense: true,
),
),
const SizedBox(height: 24),
// 🔹 Branch Name (Disabled)
TextFormField(
controller: branchNameController,
enabled: false, // changed from readOnly to disabled
decoration: InputDecoration(
labelText: AppLocalizations.of(context).branchName,
border: const OutlineInputBorder(),
isDense: true,
),
),
if (_isBeneficiaryValidated)
Column(
children: [
const SizedBox(height: 24),
TextFormField(
controller: nameController,
enabled: false,
decoration: InputDecoration(
suffixIcon: _isBeneficiaryValidated
? const Icon(
Symbols.verified,
size: 25,
fill: 1,
)
: null,
suffixIconColor:
Theme.of(context).colorScheme.primary,
labelText: AppLocalizations.of(context)
.beneficiaryName,
border: const OutlineInputBorder(),
isDense: true,
),
textInputAction: TextInputAction.next,
validator: (value) => value == null ||
value.isEmpty
? AppLocalizations.of(context).nameRequired
: null,
), ),
], obscureText: true,
), keyboardType: TextInputType.number,
const SizedBox(height: 24), textInputAction: TextInputAction.next,
if (!_isBeneficiaryValidated) onChanged: (value) {
Padding( nameController.clear();
padding: const EdgeInsets.only(bottom: 24), setState(() {
child: SizedBox( _isBeneficiaryValidated = false;
width: double.infinity, });
child: ElevatedButton( },
onPressed: _isValidating || validator: (value) {
ifscController.text.length != 11 if (value == null || value.length < 10) {
? null return AppLocalizations.of(
: () { context,
final isAccountValid = ).enterValidAccountNumber;
_accountNumberFieldKey.currentState! }
.validate(); return null;
final isConfirmAccountValid = },
_confirmAccountNumberFieldKey ),
.currentState! const SizedBox(height: 24),
.validate(); // Confirm Account Number
final isIfscValid = _ifscFieldKey TextFormField(
.currentState! key: _confirmAccountNumberFieldKey,
.validate(); controller: confirmAccountNumberController,
decoration: InputDecoration(
if (isAccountValid && labelText: AppLocalizations.of(
isConfirmAccountValid && context,
isIfscValid) { ).confirmAccountNumber,
_validateBeneficiary(); // prefixIcon: Icon(Icons.person),
} border: const OutlineInputBorder(),
}, isDense: true,
child: _isValidating ),
? const SizedBox( keyboardType: TextInputType.number,
width: 20, textInputAction: TextInputAction.next,
height: 20, validator: (value) {
child: CircularProgressIndicator( if (value == null || value.isEmpty) {
strokeWidth: 2), return AppLocalizations.of(
) context,
: Text(AppLocalizations.of(context) ).reenterAccountNumber;
.validateBeneficiary), }
if (value != accountNumberController.text) {
return AppLocalizations.of(
context,
).accountMismatch;
}
return null;
},
),
const SizedBox(height: 24),
TextFormField(
focusNode: _ifscFocusNode,
key: _ifscFieldKey,
controller: ifscController,
maxLength: 11,
inputFormatters: [
LengthLimitingTextInputFormatter(11),
],
decoration: InputDecoration(
labelText:
AppLocalizations.of(context).ifscCode,
border: const OutlineInputBorder(),
isDense: true,
),
textCapitalization: TextCapitalization.characters,
textInputAction: TextInputAction.next,
onChanged: (value) {
setState(() {
final trimmed = value.trim().toUpperCase();
if (trimmed.length < 11) {
// clear bank/branch if backspace or changed
bankNameController.clear();
branchNameController.clear();
}
});
},
validator: (value) {
final pattern =
RegExp(r'^[A-Z]{4}0[A-Z0-9]{6}$');
if (value == null || value.trim().isEmpty) {
return AppLocalizations.of(context).enterIfsc;
} else if (!pattern.hasMatch(
value.trim().toUpperCase(),
)) {
return AppLocalizations.of(
context,
).invalidIfscFormat;
}
return null;
},
),
const SizedBox(height: 24),
// Bank Name (Disabled)
TextFormField(
controller: bankNameController,
enabled:
false, // changed from readOnly to disabled
decoration: InputDecoration(
labelText:
AppLocalizations.of(context).bankName,
border: const OutlineInputBorder(),
isDense: true,
), ),
), ),
), const SizedBox(height: 24),
//Beneficiary Name (Disabled) // 🔹 Branch Name (Disabled)
// 🔹 Account Type Dropdown TextFormField(
DropdownButtonFormField<String>( controller: branchNameController,
value: accountType, enabled:
decoration: InputDecoration( false, // changed from readOnly to disabled
labelText: AppLocalizations.of(context).accountType, decoration: InputDecoration(
border: const OutlineInputBorder(), labelText:
isDense: true, AppLocalizations.of(context).branchName,
), border: const OutlineInputBorder(),
items: [ isDense: true,
'Savings', ),
'Current', ),
] if (_isBeneficiaryValidated)
.map( Column(
(type) => DropdownMenuItem( children: [
value: type, const SizedBox(height: 24),
child: Text(type), TextFormField(
), controller: nameController,
) enabled: false,
.toList(), decoration: InputDecoration(
onChanged: (value) { suffixIcon: _isBeneficiaryValidated
setState(() { ? const Icon(
accountType = value!; Symbols.verified,
}); size: 25,
}, fill: 1,
), )
: null,
suffixIconColor:
Theme.of(context).colorScheme.primary,
labelText: AppLocalizations.of(context)
.beneficiaryName,
border: const OutlineInputBorder(),
isDense: true,
),
textInputAction: TextInputAction.next,
validator: (value) =>
value == null || value.isEmpty
? AppLocalizations.of(context)
.nameRequired
: null,
),
],
),
const SizedBox(height: 24),
if (!_isBeneficiaryValidated)
Padding(
padding: const EdgeInsets.only(bottom: 24),
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _isValidating ||
ifscController.text.length != 11
? null
: () {
final isAccountValid =
_accountNumberFieldKey
.currentState!
.validate();
final isConfirmAccountValid =
_confirmAccountNumberFieldKey
.currentState!
.validate();
final isIfscValid = _ifscFieldKey
.currentState!
.validate();
const SizedBox(height: 24), if (isAccountValid &&
TextFormField( isConfirmAccountValid &&
controller: phoneController, isIfscValid) {
keyboardType: TextInputType.phone, _validateBeneficiary();
decoration: InputDecoration( }
labelText: AppLocalizations.of(context).phone, },
prefixIcon: const Icon(Icons.phone), child: _isValidating
border: const OutlineInputBorder(), ? const SizedBox(
isDense: true, width: 20,
), height: 20,
textInputAction: TextInputAction.done, child: CircularProgressIndicator(
validator: (value) => strokeWidth: 2),
value == null || value.length != 10 )
: Text(AppLocalizations.of(context)
.validateBeneficiary),
),
),
),
//Beneficiary Name (Disabled)
// 🔹 Account Type Dropdown
DropdownButtonFormField<String>(
value: accountType,
decoration: InputDecoration(
labelText:
AppLocalizations.of(context).accountType,
border: const OutlineInputBorder(),
isDense: true,
),
items: [
'Savings',
'Current',
]
.map(
(type) => DropdownMenuItem(
value: type,
child: Text(type),
),
)
.toList(),
onChanged: (value) {
setState(() {
accountType = value!;
});
},
),
const SizedBox(height: 24),
TextFormField(
controller: phoneController,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).phone,
prefixIcon: const Icon(Icons.phone),
border: const OutlineInputBorder(),
isDense: true,
),
textInputAction: TextInputAction.done,
validator: (value) => value == null ||
value.length != 10
? AppLocalizations.of(context).enterValidPhone ? AppLocalizations.of(context).enterValidPhone
: null, : null,
),
const SizedBox(height: 35),
],
), ),
const SizedBox(height: 35), ),
],
), ),
), ),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: SizedBox(
width: 250,
child: ElevatedButton(
onPressed: validateAndAddBeneficiary,
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
foregroundColor: Theme.of(context)
.colorScheme
.onPrimaryContainer),
child: Text(
AppLocalizations.of(context).validateAndAdd,
style: const TextStyle(fontSize: 16),
),
),
),
),
],
),
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
), ),
), ),
Padding( ),
padding: const EdgeInsets.symmetric(vertical: 10), ],
child: SizedBox(
width: 250,
child: ElevatedButton(
onPressed: validateAndAddBeneficiary,
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
foregroundColor:
Theme.of(context).colorScheme.onPrimaryContainer),
child: Text(
AppLocalizations.of(context).validateAndAdd,
style: const TextStyle(fontSize: 16),
),
),
),
),
],
),
), ),
), ),
); );

View File

@@ -81,60 +81,78 @@ class BeneficiaryDetailsScreen extends StatelessWidget {
title: Text(AppLocalizations.of(context).beneficiarydetails), title: Text(AppLocalizations.of(context).beneficiarydetails),
), ),
body: SafeArea( body: SafeArea(
child: Padding( child: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: Column( Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.all(16.0),
children: [ child: Column(
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
CircleAvatar( Row(
radius: 24, children: [
backgroundColor: Colors.transparent, CircleAvatar(
child: getBankLogo(beneficiary.bankName, context), radius: 24,
backgroundColor: Colors.transparent,
child: getBankLogo(beneficiary.bankName, context),
),
const SizedBox(width: 16),
Text(
beneficiary.name,
style: const TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
),
],
), ),
const SizedBox(width: 16), const SizedBox(height: 24),
Text( _buildDetailRow('${AppLocalizations.of(context).bankName} ',
beneficiary.name, beneficiary.bankName ?? 'N/A'),
style: const TextStyle( _buildDetailRow(
fontSize: 20, fontWeight: FontWeight.bold), '${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,
children: [
// ElevatedButton.icon(
// onPressed: () {
// // Set Transaction Limit for this beneficiary
// },
// icon: const Icon(Icons.currency_rupee),
// label: const Text('Set Limit'),
// ),
ElevatedButton.icon(
onPressed: () {
// Delete beneficiary option
_showDeleteConfirmationDialog(context);
},
icon: const Icon(Icons.delete),
label: Text(AppLocalizations.of(context).delete),
),
],
), ),
], ],
), ),
const SizedBox(height: 24), ),
_buildDetailRow('${AppLocalizations.of(context).bankName} ', IgnorePointer(
beneficiary.bankName ?? 'N/A'), child: Center(
_buildDetailRow('${AppLocalizations.of(context).accountNumber} ', child: Opacity(
beneficiary.accountNo), opacity: 0.1, // Low opacity
_buildDetailRow('${AppLocalizations.of(context).accountType} ', child: Image.asset(
beneficiary.accountType), 'assets/images/logo.png',
_buildDetailRow('${AppLocalizations.of(context).ifscCode} ', width: 200, // Adjust size as needed
beneficiary.ifscCode), height: 200, // Adjust size as needed
_buildDetailRow('${AppLocalizations.of(context).branchName} ',
beneficiary.branchName ?? 'N/A'),
const Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
// ElevatedButton.icon(
// onPressed: () {
// // Set Transaction Limit for this beneficiary
// },
// icon: const Icon(Icons.currency_rupee),
// label: const Text('Set Limit'),
// ),
ElevatedButton.icon(
onPressed: () {
// Delete beneficiary option
_showDeleteConfirmationDialog(context);
},
icon: const Icon(Icons.delete),
label: Text(AppLocalizations.of(context).delete),
), ),
], ),
), ),
], ),
), ],
), ),
), ),
); );

View File

@@ -109,7 +109,23 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context).beneficiaries), title: Text(AppLocalizations.of(context).beneficiaries),
), ),
body: _isLoading ? _buildShimmerList() : _buildBeneficiaryList(), body: Stack(
children: [
_isLoading ? _buildShimmerList() : _buildBeneficiaryList(),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
),
floatingActionButton: Padding( floatingActionButton: Padding(
padding: const EdgeInsets.only(bottom: 8.0), padding: const EdgeInsets.only(bottom: 8.0),
child: FloatingActionButton( child: FloatingActionButton(

View File

@@ -61,132 +61,154 @@ class _BlockCardScreen extends State<BlockCardScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: Padding( body: Stack(
padding: const EdgeInsets.all(10.0), children: [
child: Form( Padding(
key: _formKey, padding: const EdgeInsets.all(10.0),
child: ListView( child: Form(
children: [ key: _formKey,
const SizedBox(height: 10), child: ListView(
TextFormField(
controller: _cardController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).cardNumber,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) => value != null && value.length == 11
? null
: AppLocalizations.of(context).enterValidCardNumber,
),
const SizedBox(height: 24),
Row(
children: [ children: [
Expanded( const SizedBox(height: 10),
child: TextFormField( TextFormField(
controller: _cvvController, controller: _cardController,
decoration: InputDecoration( decoration: InputDecoration(
labelText: AppLocalizations.of(context).cvv, labelText: AppLocalizations.of(context).cardNumber,
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black), borderSide: BorderSide(color: Colors.black),
), ),
focusedBorder: const OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2), borderSide: BorderSide(color: Colors.black, width: 2),
),
), ),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
obscureText: true,
validator: (value) => value != null && value.length == 3
? null
: AppLocalizations.of(context).cvv3Digits,
), ),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) => value != null && value.length == 11
? null
: AppLocalizations.of(context).enterValidCardNumber,
), ),
const SizedBox(width: 16), const SizedBox(height: 24),
Expanded( Row(
child: TextFormField( children: [
controller: _expiryController, Expanded(
readOnly: true, child: TextFormField(
onTap: _pickExpiryDate, controller: _cvvController,
decoration: InputDecoration( decoration: InputDecoration(
labelText: AppLocalizations.of(context).expiryDate, labelText: AppLocalizations.of(context).cvv,
suffixIcon: const Icon(Icons.calendar_today), border: const OutlineInputBorder(),
border: const OutlineInputBorder(), isDense: true,
isDense: true, filled: true,
filled: true, fillColor:
fillColor: Theme.of(context).scaffoldBackgroundColor, Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black), borderSide: BorderSide(color: Colors.black),
), ),
focusedBorder: const OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2), borderSide:
BorderSide(color: Colors.black, width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
obscureText: true,
validator: (value) =>
value != null && value.length == 3
? null
: AppLocalizations.of(context).cvv3Digits,
), ),
), ),
validator: (value) => value != null && value.isNotEmpty const SizedBox(width: 16),
? null Expanded(
: AppLocalizations.of(context).selectExpiryDate, child: TextFormField(
controller: _expiryController,
readOnly: true,
onTap: _pickExpiryDate,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).expiryDate,
suffixIcon: const Icon(Icons.calendar_today),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black, width: 2),
),
),
validator: (value) => value != null &&
value.isNotEmpty
? null
: AppLocalizations.of(context).selectExpiryDate,
),
),
],
),
const SizedBox(height: 24),
TextFormField(
controller: _phoneController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).phone,
prefixIcon: const Icon(Icons.phone),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2),
),
),
textInputAction: TextInputAction.done,
keyboardType: TextInputType.phone,
validator: (value) => value != null && value.length >= 10
? null
: AppLocalizations.of(context).enterValidPhone,
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SizedBox(
width: 250,
child: ElevatedButton(
onPressed: _blockCard,
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Theme.of(context).primaryColor,
foregroundColor:
Theme.of(context).scaffoldBackgroundColor,
),
child: Text(AppLocalizations.of(context).block),
),
), ),
), ),
], ],
), ),
const SizedBox(height: 24), ),
TextFormField(
controller: _phoneController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).phone,
prefixIcon: const Icon(Icons.phone),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2),
),
),
textInputAction: TextInputAction.done,
keyboardType: TextInputType.phone,
validator: (value) => value != null && value.length >= 10
? null
: AppLocalizations.of(context).enterValidPhone,
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SizedBox(
width: 250,
child: ElevatedButton(
onPressed: _blockCard,
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Theme.of(context).primaryColor,
foregroundColor:
Theme.of(context).scaffoldBackgroundColor,
),
child: Text(AppLocalizations.of(context).block),
),
),
),
],
), ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
); );
} }

View File

@@ -9,27 +9,43 @@ class CardDetailsScreen extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
title: const Text("My Cards"), title: const Text("My Cards"),
), ),
body: Padding( body: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: ListView( Padding(
children: const [ padding: const EdgeInsets.all(16.0),
CardTile( child: ListView(
cardNumber: "**** **** **** 1234", children: const [
cardNetwork: "VISA", CardTile(
cardType: "Debit Card", cardNumber: "**** **** **** 1234",
validFrom: "01/22", cardNetwork: "VISA",
validTo: "01/27", cardType: "Debit Card",
validFrom: "01/22",
validTo: "01/27",
),
SizedBox(height: 16),
CardTile(
cardNumber: "**** **** **** 5678",
cardNetwork: "Mastercard",
cardType: "Debit Card",
validFrom: "07/21",
validTo: "07/26",
),
],
), ),
SizedBox(height: 16), ),
CardTile( IgnorePointer(
cardNumber: "**** **** **** 5678", child: Center(
cardNetwork: "Mastercard", child: Opacity(
cardType: "Debit Card", opacity: 0.1, // Low opacity
validFrom: "07/21", child: Image.asset(
validTo: "07/26", 'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
), ),
], ),
), ],
), ),
); );
} }

View File

@@ -25,57 +25,73 @@ class _CardManagementScreen extends State<CardManagementScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: ListView( body: Stack(
children: [ children: [
CardManagementTile( ListView(
icon: Symbols.add, children: [
label: AppLocalizations.of(context).applyDebitCard, CardManagementTile(
onTap: () {}, icon: Symbols.add,
disabled: true, // Add this label: AppLocalizations.of(context).applyDebitCard,
onTap: () {},
disabled: true, // Add this
),
const Divider(height: 1),
CardManagementTile(
icon: Symbols.remove_moderator,
label: AppLocalizations.of(context).blockUnblockCard,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const BlockCardScreen(),
),
);
},
disabled: true,
),
const Divider(height: 1),
CardManagementTile(
icon: Symbols.password_2,
label: AppLocalizations.of(context).changeCardPin,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CardPinChangeDetailsScreen(),
),
);
},
disabled: true,
),
const Divider(height: 1),
CardManagementTile(
icon: Symbols.payment_card,
label: AppLocalizations.of(context).viewCardDeatils,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CardDetailsScreen(),
),
);
},
disabled: true,
),
const Divider(height: 1),
],
), ),
const Divider(height: 1), IgnorePointer(
CardManagementTile( child: Center(
icon: Symbols.remove_moderator, child: Opacity(
label: AppLocalizations.of(context).blockUnblockCard, opacity: 0.1, // Low opacity
onTap: () { child: Image.asset(
Navigator.push( 'assets/images/logo.png',
context, width: 200, // Adjust size as needed
MaterialPageRoute( height: 200, // Adjust size as needed
builder: (context) => const BlockCardScreen(),
), ),
); ),
}, ),
disabled: true,
), ),
const Divider(height: 1),
CardManagementTile(
icon: Symbols.password_2,
label: AppLocalizations.of(context).changeCardPin,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CardPinChangeDetailsScreen(),
),
);
},
disabled: true,
),
const Divider(height: 1),
CardManagementTile(
icon: Symbols.payment_card,
label: AppLocalizations.of(context).viewCardDeatils,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CardDetailsScreen(),
),
);
},
disabled: true,
),
const Divider(height: 1),
], ],
), ),
); );

View File

@@ -51,132 +51,154 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: Padding( body: Stack(
padding: const EdgeInsets.all(10.0), children: [
child: Form( Padding(
key: _formKey, padding: const EdgeInsets.all(10.0),
child: ListView( child: Form(
children: [ key: _formKey,
const SizedBox(height: 10), child: ListView(
TextFormField(
controller: _cardController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).cardNumber,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) => value != null && value.length == 11
? null
: AppLocalizations.of(context).enterValidCardNumber,
),
const SizedBox(height: 24),
Row(
children: [ children: [
Expanded( const SizedBox(height: 10),
child: TextFormField( TextFormField(
controller: _cvvController, controller: _cardController,
decoration: InputDecoration( decoration: InputDecoration(
labelText: AppLocalizations.of(context).cvv, labelText: AppLocalizations.of(context).cardNumber,
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black), borderSide: BorderSide(color: Colors.black),
), ),
focusedBorder: const OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2), borderSide: BorderSide(color: Colors.black, width: 2),
),
), ),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
obscureText: true,
validator: (value) => value != null && value.length == 3
? null
: AppLocalizations.of(context).cvv3Digits,
), ),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) => value != null && value.length == 11
? null
: AppLocalizations.of(context).enterValidCardNumber,
), ),
const SizedBox(width: 16), const SizedBox(height: 24),
Expanded( Row(
child: TextFormField( children: [
controller: _expiryController, Expanded(
readOnly: true, child: TextFormField(
onTap: _pickExpiryDate, controller: _cvvController,
decoration: InputDecoration( decoration: InputDecoration(
labelText: AppLocalizations.of(context).expiryDate, labelText: AppLocalizations.of(context).cvv,
suffixIcon: const Icon(Icons.calendar_today), border: const OutlineInputBorder(),
border: const OutlineInputBorder(), isDense: true,
isDense: true, filled: true,
filled: true, fillColor:
fillColor: Theme.of(context).scaffoldBackgroundColor, Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black), borderSide: BorderSide(color: Colors.black),
), ),
focusedBorder: const OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2), borderSide:
BorderSide(color: Colors.black, width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
obscureText: true,
validator: (value) =>
value != null && value.length == 3
? null
: AppLocalizations.of(context).cvv3Digits,
), ),
), ),
validator: (value) => value != null && value.isNotEmpty const SizedBox(width: 16),
? null Expanded(
: AppLocalizations.of(context).selectExpiryDate, child: TextFormField(
controller: _expiryController,
readOnly: true,
onTap: _pickExpiryDate,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).expiryDate,
suffixIcon: const Icon(Icons.calendar_today),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black, width: 2),
),
),
validator: (value) => value != null &&
value.isNotEmpty
? null
: AppLocalizations.of(context).selectExpiryDate,
),
),
],
),
const SizedBox(height: 24),
TextFormField(
controller: _phoneController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).phone,
prefixIcon: const Icon(Icons.phone),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2),
),
),
textInputAction: TextInputAction.done,
keyboardType: TextInputType.phone,
validator: (value) => value != null && value.length >= 10
? null
: AppLocalizations.of(context).enterValidPhone,
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SizedBox(
width: 250,
child: ElevatedButton(
onPressed: _nextButton,
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Theme.of(context).primaryColor,
foregroundColor:
Theme.of(context).scaffoldBackgroundColor,
),
child: Text(AppLocalizations.of(context).next),
),
), ),
), ),
], ],
), ),
const SizedBox(height: 24), ),
TextFormField(
controller: _phoneController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).phone,
prefixIcon: const Icon(Icons.phone),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2),
),
),
textInputAction: TextInputAction.done,
keyboardType: TextInputType.phone,
validator: (value) => value != null && value.length >= 10
? null
: AppLocalizations.of(context).enterValidPhone,
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SizedBox(
width: 250,
child: ElevatedButton(
onPressed: _nextButton,
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Theme.of(context).primaryColor,
foregroundColor:
Theme.of(context).scaffoldBackgroundColor,
),
child: Text(AppLocalizations.of(context).next),
),
),
),
],
), ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
); );
} }

View File

@@ -51,87 +51,103 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: Padding( body: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: Form( Padding(
key: _formKey, padding: const EdgeInsets.all(16.0),
child: Column( child: Form(
children: [ key: _formKey,
TextFormField( child: Column(
controller: _pinController, children: [
obscureText: true, TextFormField(
decoration: InputDecoration( controller: _pinController,
labelText: AppLocalizations.of(context).enterNewPin, obscureText: true,
border: const OutlineInputBorder(), decoration: InputDecoration(
isDense: true, labelText: AppLocalizations.of(context).enterNewPin,
filled: true, border: const OutlineInputBorder(),
fillColor: Theme.of(context).scaffoldBackgroundColor, isDense: true,
enabledBorder: const OutlineInputBorder( filled: true,
borderSide: BorderSide(color: Colors.black), fillColor: Theme.of(context).scaffoldBackgroundColor,
), enabledBorder: const OutlineInputBorder(
focusedBorder: const OutlineInputBorder( borderSide: BorderSide(color: Colors.black),
borderSide: BorderSide(color: Colors.black, width: 2), ),
), focusedBorder: const OutlineInputBorder(
), borderSide: BorderSide(color: Colors.black, width: 2),
keyboardType: TextInputType.number, ),
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).pleaseEnterNewPin;
}
if (value.length < 4) {
return AppLocalizations.of(context).pin4Digits;
}
return null;
},
),
const SizedBox(height: 24),
TextFormField(
controller: _confirmPinController,
obscureText: true,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).enterAgain,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.done,
validator: (value) {
if (value != _pinController.text) {
return AppLocalizations.of(context).pinsDoNotMatch;
}
return null;
},
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SizedBox(
width: 250,
child: ElevatedButton(
onPressed: _submit,
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Theme.of(context).primaryColor,
foregroundColor:
Theme.of(context).scaffoldBackgroundColor,
), ),
child: Text(AppLocalizations.of(context).submit), keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).pleaseEnterNewPin;
}
if (value.length < 4) {
return AppLocalizations.of(context).pin4Digits;
}
return null;
},
), ),
const SizedBox(height: 24),
TextFormField(
controller: _confirmPinController,
obscureText: true,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).enterAgain,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.done,
validator: (value) {
if (value != _pinController.text) {
return AppLocalizations.of(context).pinsDoNotMatch;
}
return null;
},
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SizedBox(
width: 250,
child: ElevatedButton(
onPressed: _submit,
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Theme.of(context).primaryColor,
foregroundColor:
Theme.of(context).scaffoldBackgroundColor,
),
child: Text(AppLocalizations.of(context).submit),
),
),
),
],
),
),
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
), ),
), ),
], ),
), ),
), ],
), ),
); );
} }

View File

@@ -22,50 +22,67 @@ class _ChequeManagementScreen extends State<ChequeManagementScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: ListView( body: Stack(
children: [ children: [
const SizedBox(height: 15), ListView(
ChequeManagementTile( children: [
icon: Symbols.add, const SizedBox(height: 15),
label: AppLocalizations.of(context).requestChequeBook, ChequeManagementTile(
onTap: () {}, icon: Symbols.add,
label: AppLocalizations.of(context).requestChequeBook,
onTap: () {},
),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.data_alert,
label: AppLocalizations.of(context).enquiry,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const EnquiryScreen()),
);
},
),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.approval_delegation,
label: AppLocalizations.of(context).chequeDeposit,
onTap: () {},
),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.front_hand,
label: AppLocalizations.of(context).stopCheque,
onTap: () {},
),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.cancel_presentation,
label: AppLocalizations.of(context).revokeStop,
onTap: () {},
),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.payments,
label: AppLocalizations.of(context).positivePay,
onTap: () {},
),
const Divider(height: 1),
],
), ),
const Divider(height: 1), IgnorePointer(
ChequeManagementTile( child: Center(
icon: Symbols.data_alert, child: Opacity(
label: AppLocalizations.of(context).enquiry, opacity: 0.1, // Low opacity
onTap: () { child: Image.asset(
Navigator.push( 'assets/images/logo.png',
context, width: 200, // Adjust size as needed
MaterialPageRoute(builder: (context) => const EnquiryScreen()), height: 200, // Adjust size as needed
); ),
}, ),
),
), ),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.approval_delegation,
label: AppLocalizations.of(context).chequeDeposit,
onTap: () {},
),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.front_hand,
label: AppLocalizations.of(context).stopCheque,
onTap: () {},
),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.cancel_presentation,
label: AppLocalizations.of(context).revokeStop,
onTap: () {},
),
const Divider(height: 1),
ChequeManagementTile(
icon: Symbols.payments,
label: AppLocalizations.of(context).positivePay,
onTap: () {},
),
const Divider(height: 1),
], ],
), ),
); );

View File

@@ -33,74 +33,90 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
.replaceFirst(RegExp('\n'), ''), .replaceFirst(RegExp('\n'), ''),
), ),
), ),
body: SingleChildScrollView( body: Stack(
physics: const AlwaysScrollableScrollPhysics(), children: [
child: Padding( SingleChildScrollView(
padding: const EdgeInsets.all(16.0), physics: const AlwaysScrollableScrollPhysics(),
child: SafeArea( child: Padding(
child: Center( padding: const EdgeInsets.all(16.0),
child: Column( child: SafeArea(
children: [ child: Center(
const SizedBox(height: 30), child: Column(
CircleAvatar( children: [
radius: 50, const SizedBox(height: 30),
child: SvgPicture.asset( CircleAvatar(
'assets/images/avatar_male.svg', radius: 50,
width: 150, child: SvgPicture.asset(
height: 150, 'assets/images/avatar_male.svg',
fit: BoxFit.cover, width: 150,
), height: 150,
), fit: BoxFit.cover,
Padding( ),
padding: const EdgeInsets.only(top: 10.0),
child: Text(
user.name ?? '',
style: TextStyle(
fontSize: 20,
color: theme.colorScheme.onSurface,
fontWeight: FontWeight.w500,
), ),
), Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Text(
user.name ?? '',
style: TextStyle(
fontSize: 20,
color: theme.colorScheme.onSurface,
fontWeight: FontWeight.w500,
),
),
),
Text(
'${AppLocalizations.of(context).cif}: ${user.cifNumber ?? 'N/A'}',
style: TextStyle(
fontSize: 16,
color: theme.colorScheme.onSurfaceVariant),
),
const SizedBox(height: 30),
InfoField(
label: AppLocalizations.of(context).activeAccounts,
value: user.activeAccounts?.toString() ?? '6',
),
InfoField(
label: AppLocalizations.of(context).mobileNumber,
value: user.mobileNo ?? 'N/A',
),
InfoField(
label: AppLocalizations.of(context).dateOfBirth,
value: (user.dateOfBirth != null &&
user.dateOfBirth!.length == 8)
? '${user.dateOfBirth!.substring(0, 2)}-${user.dateOfBirth!.substring(2, 4)}-${user.dateOfBirth!.substring(4, 8)}'
: 'N/A',
), // Replace with DOB if available
InfoField(
label: AppLocalizations.of(context).branchCode,
value: user.branchId ?? 'N/A',
),
InfoField(
label: AppLocalizations.of(context).branchAddress,
value: user.address ?? 'N/A',
), // Replace with Aadhar if available
InfoField(
label: AppLocalizations.of(context).primaryId,
value: _maskPrimaryId(user.primaryId),
), // Replace with PAN if available
],
), ),
Text( ),
'${AppLocalizations.of(context).cif}: ${user.cifNumber ?? 'N/A'}',
style: TextStyle(
fontSize: 16,
color: theme.colorScheme.onSurfaceVariant),
),
const SizedBox(height: 30),
InfoField(
label: AppLocalizations.of(context).activeAccounts,
value: user.activeAccounts?.toString() ?? '6',
),
InfoField(
label: AppLocalizations.of(context).mobileNumber,
value: user.mobileNo ?? 'N/A',
),
InfoField(
label: AppLocalizations.of(context).dateOfBirth,
value: (user.dateOfBirth != null &&
user.dateOfBirth!.length == 8)
? '${user.dateOfBirth!.substring(0, 2)}-${user.dateOfBirth!.substring(2, 4)}-${user.dateOfBirth!.substring(4, 8)}'
: 'N/A',
), // Replace with DOB if available
InfoField(
label: AppLocalizations.of(context).branchCode,
value: user.branchId ?? 'N/A',
),
InfoField(
label: AppLocalizations.of(context).branchAddress,
value: user.address ?? 'N/A',
), // Replace with Aadhar if available
InfoField(
label: AppLocalizations.of(context).primaryId,
value: _maskPrimaryId(user.primaryId),
), // Replace with PAN if available
],
), ),
), ),
), ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
); );
} }

View File

@@ -15,6 +15,7 @@ import 'package:kmobile/features/enquiry/screens/enquiry_screen.dart';
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_screen.dart'; import 'package:kmobile/features/fund_transfer/screens/fund_transfer_screen.dart';
import 'package:kmobile/features/profile/profile_screen.dart'; import 'package:kmobile/features/profile/profile_screen.dart';
import 'package:kmobile/features/quick_pay/screens/quick_pay_screen.dart'; import 'package:kmobile/features/quick_pay/screens/quick_pay_screen.dart';
import 'package:kmobile/features/service/screens/branch_locator_screen.dart';
import 'package:kmobile/security/secure_storage.dart'; import 'package:kmobile/security/secure_storage.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart'; import 'package:material_symbols_icons/material_symbols_icons.dart';
@@ -547,9 +548,14 @@ class _DashboardScreenState extends State<DashboardScreen>
.accountType!, .accountType!,
))); )));
}), }),
_buildQuickLink(Symbols.checkbook, _buildQuickLink(Icons.location_pin, "Branch Locator",
AppLocalizations.of(context).handleCheque, () {}, () {
disable: true), Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const BranchLocatorScreen()));
}, disable: false),
_buildQuickLink(Icons.group, _buildQuickLink(Icons.group,
AppLocalizations.of(context).manageBeneficiary, AppLocalizations.of(context).manageBeneficiary,
() { () {

View File

@@ -70,66 +70,83 @@ class _EnquiryScreen extends State<EnquiryScreen> {
title: Text(AppLocalizations.of(context).enquiry), title: Text(AppLocalizations.of(context).enquiry),
centerTitle: false, centerTitle: false,
), ),
body: Padding( body: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: Column( Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.all(16.0),
children: [ child: Column(
const SizedBox(height: 20), crossAxisAlignment: CrossAxisAlignment.start,
GestureDetector( children: [
onTap: () => _launchUrl("https://kccb.in/complaint-form"), const SizedBox(height: 20),
child: Row(mainAxisSize: MainAxisSize.min, children: [ GestureDetector(
Text( onTap: () => _launchUrl("https://kccb.in/complaint-form"),
"Complaint Form", child: Row(mainAxisSize: MainAxisSize.min, children: [
style: TextStyle( Text(
fontSize: 17, "Complaint Form",
color: Theme.of(context).colorScheme.primary, style: TextStyle(
decorationColor: Theme.of(context).colorScheme.primary, fontSize: 17,
), color: Theme.of(context).colorScheme.primary,
), decorationColor:
const SizedBox(width: 4), Theme.of(context).colorScheme.primary,
Icon( ),
Icons.open_in_new, ),
const SizedBox(width: 4),
Icon(
Icons.open_in_new,
color: Theme.of(context).colorScheme.primary,
size: 16.0,
),
])),
const SizedBox(height: 40),
Text(
AppLocalizations.of(context).keyContacts,
style: TextStyle(
fontSize: 17,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
size: 16.0,
), ),
])), // horizontal line
const SizedBox(height: 40), ),
Text( Divider(color: Theme.of(context).colorScheme.outline),
AppLocalizations.of(context).keyContacts, const SizedBox(height: 16),
style: TextStyle( _buildContactItem(
fontSize: 17, AppLocalizations.of(context).chairman,
color: Theme.of(context).colorScheme.primary, "chairman@kccb.in",
"01892-222677",
),
const SizedBox(height: 16),
_buildContactItem(
AppLocalizations.of(context).managingDirector,
"md@kccb.in",
"01892-224969",
),
const SizedBox(height: 16),
_buildContactItem(
AppLocalizations.of(context).gmWest,
"gmw@kccb.in",
"01892-223280",
),
const SizedBox(height: 16),
_buildContactItem(
AppLocalizations.of(context).gmNorth,
"gmn@kccb.in",
"01892-224607",
),
],
),
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
), ),
// horizontal line
), ),
Divider(color: Theme.of(context).colorScheme.outline), ),
const SizedBox(height: 16), ],
_buildContactItem(
AppLocalizations.of(context).chairman,
"chairman@kccb.in",
"01892-222677",
),
const SizedBox(height: 16),
_buildContactItem(
AppLocalizations.of(context).managingDirector,
"md@kccb.in",
"01892-224969",
),
const SizedBox(height: 16),
_buildContactItem(
AppLocalizations.of(context).gmWest,
"gmw@kccb.in",
"01892-223280",
),
const SizedBox(height: 16),
_buildContactItem(
AppLocalizations.of(context).gmNorth,
"gmn@kccb.in",
"01892-224607",
),
],
),
), ),
); );
} }

View File

@@ -362,156 +362,173 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
title: Text(loc.fundTransfer.replaceFirst(RegExp('\n'), '')), title: Text(loc.fundTransfer.replaceFirst(RegExp('\n'), '')),
), ),
body: SafeArea( body: SafeArea(
child: Padding( child: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: Form( Padding(
key: _formKey, padding: const EdgeInsets.all(16.0),
child: Column( child: Form(
crossAxisAlignment: CrossAxisAlignment.start, key: _formKey,
children: [ child: Column(
// Debit Account (User) crossAxisAlignment: CrossAxisAlignment.start,
Text( children: [
loc.debitFrom, // Debit Account (User)
style: Theme.of(context).textTheme.titleSmall, Text(
), loc.debitFrom,
Card( style: Theme.of(context).textTheme.titleSmall,
elevation: 0,
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading: Image.asset(
'assets/images/logo.png',
width: 40,
height: 40,
), ),
title: Text(widget.remitterName), Card(
subtitle: Text(widget.debitAccountNo), elevation: 0,
), margin: const EdgeInsets.symmetric(vertical: 8.0),
), child: ListTile(
const SizedBox(height: 24), leading: Image.asset(
'assets/images/logo.png',
// Credit Account (Beneficiary) width: 40,
Text( height: 40,
AppLocalizations.of(context).creditedTo, ),
style: Theme.of(context).textTheme.titleSmall, title: Text(widget.remitterName),
), subtitle: Text(widget.debitAccountNo),
Card( ),
elevation: 0,
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading:
getBankLogo(widget.creditBeneficiary.bankName, context),
title: Text(widget.creditBeneficiary.name),
subtitle: Text(widget.creditBeneficiary.accountNo),
),
),
const SizedBox(height: 24),
if (!widget.isOwnBank) ...[
// Transaction Mode Selection
Text(
AppLocalizations.of(context).selectTransactionType,
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 12),
Container(
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.grey.shade300),
), ),
child: ToggleButtons( const SizedBox(height: 24),
isSelected: [
_selectedMode == TransactionMode.neft, // Credit Account (Beneficiary)
_selectedMode == TransactionMode.rtgs, Text(
_selectedMode == TransactionMode.imps, AppLocalizations.of(context).creditedTo,
], style: Theme.of(context).textTheme.titleSmall,
onPressed: (index) { ),
setState(() { Card(
_selectedMode = TransactionMode.values[index]; elevation: 0,
}); margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading: getBankLogo(
widget.creditBeneficiary.bankName, context),
title: Text(widget.creditBeneficiary.name),
subtitle: Text(widget.creditBeneficiary.accountNo),
),
),
const SizedBox(height: 24),
if (!widget.isOwnBank) ...[
// Transaction Mode Selection
Text(
AppLocalizations.of(context).selectTransactionType,
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 12),
Container(
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.grey.shade300),
),
child: ToggleButtons(
isSelected: [
_selectedMode == TransactionMode.neft,
_selectedMode == TransactionMode.rtgs,
_selectedMode == TransactionMode.imps,
],
onPressed: (index) {
setState(() {
_selectedMode = TransactionMode.values[index];
});
},
borderRadius: BorderRadius.circular(10),
selectedColor:
Theme.of(context).colorScheme.onPrimary,
fillColor: Theme.of(context).colorScheme.primary,
color: Theme.of(context).colorScheme.onSurface,
borderColor: Colors.transparent,
selectedBorderColor: Colors.transparent,
splashColor: Theme.of(context).colorScheme.primary,
highlightColor: Theme.of(context).colorScheme.primary,
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).neft),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).rtgs),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).imps),
),
],
),
),
const SizedBox(height: 24),
],
//Remarks
TextFormField(
controller: _remarksController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).remarks,
border: const OutlineInputBorder(),
),
),
const SizedBox(height: 24),
// Amount
TextFormField(
controller: _amountController,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: loc.amount,
border: const OutlineInputBorder(),
prefixIcon: const Icon(Icons.currency_rupee),
),
validator: (value) {
if (value == null || value.isEmpty) {
return loc.amountRequired;
}
if (double.tryParse(value) == null ||
double.parse(value) <= 0) {
return loc.validAmount;
}
return null;
}, },
borderRadius: BorderRadius.circular(10),
selectedColor: Theme.of(context).colorScheme.onPrimary,
fillColor: Theme.of(context).colorScheme.primary,
color: Theme.of(context).colorScheme.onSurface,
borderColor: Colors.transparent,
selectedBorderColor: Colors.transparent,
splashColor: Theme.of(context).colorScheme.primary,
highlightColor: Theme.of(context).colorScheme.primary,
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).neft),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).rtgs),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).imps),
),
],
), ),
), const SizedBox(height: 8),
const SizedBox(height: 24), if (_isLoadingLimit) const Text('Fetching daily limit...'),
], if (!_isLoadingLimit && _limit != null)
//Remarks Text(
TextFormField( 'Remaining Daily Limit: ${_formatCurrency.format(_limit!.dailyLimit - _limit!.usedLimit)}',
controller: _remarksController, style: Theme.of(context).textTheme.bodySmall,
decoration: InputDecoration( ),
labelText: AppLocalizations.of(context).remarks, const Spacer(),
border: const OutlineInputBorder(),
),
),
const SizedBox(height: 24),
// Amount
TextFormField(
controller: _amountController,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: loc.amount,
border: const OutlineInputBorder(),
prefixIcon: const Icon(Icons.currency_rupee),
),
validator: (value) {
if (value == null || value.isEmpty) {
return loc.amountRequired;
}
if (double.tryParse(value) == null ||
double.parse(value) <= 0) {
return loc.validAmount;
}
return null;
},
),
const SizedBox(height: 8),
if (_isLoadingLimit) const Text('Fetching daily limit...'),
if (!_isLoadingLimit && _limit != null)
Text(
'Remaining Daily Limit: ${_formatCurrency.format(_limit!.dailyLimit - _limit!.usedLimit)}',
style: Theme.of(context).textTheme.bodySmall,
),
const Spacer(),
// Proceed Button // Proceed Button
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
child: ElevatedButton( child: ElevatedButton(
onPressed: _isAmountOverLimit ? null : _onProceed, onPressed: _isAmountOverLimit ? null : _onProceed,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),
),
child: Text(AppLocalizations.of(context).proceed),
),
), ),
child: Text(AppLocalizations.of(context).proceed), const SizedBox(height: 10),
],
),
),
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
), ),
), ),
const SizedBox(height: 10), ),
],
), ),
), ],
), ),
), ),
); );

View File

@@ -160,7 +160,23 @@ class _FundTransferBeneficiaryScreenState
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context).beneficiaries), title: Text(AppLocalizations.of(context).beneficiaries),
), ),
body: _isLoading ? _buildShimmerList() : _buildBeneficiaryList(), body: Stack(
children: [
_isLoading ? _buildShimmerList() : _buildBeneficiaryList(),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
),
); );
} }
} }

View File

@@ -32,65 +32,81 @@ class FundTransferScreen extends StatelessWidget {
// Wrap with BlocBuilder to check the authentication state // Wrap with BlocBuilder to check the authentication state
body: BlocBuilder<AuthCubit, AuthState>( body: BlocBuilder<AuthCubit, AuthState>(
builder: (context, state) { builder: (context, state) {
return ListView( return Stack(
children: [ children: [
FundTransferManagementTile( ListView(
icon: Symbols.person, children: [
// Restore localization for the label FundTransferManagementTile(
label: "Self Pay", icon: Symbols.person,
onTap: () { // Restore localization for the label
// The accounts list is passed directly from the constructor label: "Self Pay",
Navigator.push( onTap: () {
context, // The accounts list is passed directly from the constructor
MaterialPageRoute( Navigator.push(
builder: (context) => FundTransferSelfAccountsScreen( context,
debitAccountNo: creditAccountNo, MaterialPageRoute(
remitterName: remitterName, builder: (context) => FundTransferSelfAccountsScreen(
accounts: accounts, debitAccountNo: creditAccountNo,
), remitterName: remitterName,
), accounts: accounts,
); ),
}, ),
// Disable the tile if the state is not Authenticated );
disable: state is! Authenticated, },
// Disable the tile if the state is not Authenticated
disable: state is! Authenticated,
),
const Divider(height: 1),
FundTransferManagementTile(
icon: Symbols.input_circle,
// Restore localization for the label
label: AppLocalizations.of(context).ownBank,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FundTransferBeneficiaryScreen(
creditAccountNo: creditAccountNo,
remitterName: remitterName,
isOwnBank: true,
),
),
);
},
),
const Divider(height: 1),
FundTransferManagementTile(
icon: Symbols.output_circle,
// Restore localization for the label
label: AppLocalizations.of(context).outsideBank,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FundTransferBeneficiaryScreen(
creditAccountNo: creditAccountNo,
remitterName: remitterName,
isOwnBank: false,
),
),
);
},
),
const Divider(height: 1),
],
), ),
const Divider(height: 1), IgnorePointer(
FundTransferManagementTile( child: Center(
icon: Symbols.input_circle, child: Opacity(
// Restore localization for the label opacity: 0.1, // Low opacity
label: AppLocalizations.of(context).ownBank, child: Image.asset(
onTap: () { 'assets/images/logo.png',
Navigator.push( width: 200, // Adjust size as needed
context, height: 200, // Adjust size as needed
MaterialPageRoute(
builder: (context) => FundTransferBeneficiaryScreen(
creditAccountNo: creditAccountNo,
remitterName: remitterName,
isOwnBank: true,
),
), ),
); ),
}, ),
), ),
const Divider(height: 1),
FundTransferManagementTile(
icon: Symbols.output_circle,
// Restore localization for the label
label: AppLocalizations.of(context).outsideBank,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FundTransferBeneficiaryScreen(
creditAccountNo: creditAccountNo,
remitterName: remitterName,
isOwnBank: false,
),
),
);
},
),
const Divider(height: 1),
], ],
); );
}, },

View File

@@ -45,49 +45,66 @@ class FundTransferSelfAccountsScreen extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
title: const Text("Select Account"), title: const Text("Select Account"),
), ),
body: filteredAccounts.isEmpty body: Stack(
? const Center( children: [
child: Text("No other accounts found"), filteredAccounts.isEmpty
) ? const Center(
: ListView.builder( child: Text("No other accounts found"),
itemCount: filteredAccounts.length, )
itemBuilder: (context, index) { : ListView.builder(
final account = filteredAccounts[index]; itemCount: filteredAccounts.length,
return ListTile( itemBuilder: (context, index) {
leading: CircleAvatar( final account = filteredAccounts[index];
radius: 24, return ListTile(
backgroundColor: Colors.transparent, leading: CircleAvatar(
child: getBankLogo( radius: 24,
'Kangra Central Co-operative Bank', context), backgroundColor: Colors.transparent,
), child: getBankLogo(
title: Text(account.name ?? 'N/A'), 'Kangra Central Co-operative Bank', context),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(account.accountNo ?? 'N/A'),
Text(
_getFullAccountType(account.accountType),
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
), ),
], title: Text(account.name ?? 'N/A'),
), subtitle: Column(
onTap: () { crossAxisAlignment: CrossAxisAlignment.start,
// Navigate to the amount screen, passing the selected User object directly. children: [
// No Beneficiary object is created. Text(account.accountNo ?? 'N/A'),
Navigator.push( Text(
context, _getFullAccountType(account.accountType),
MaterialPageRoute( style: TextStyle(
builder: (context) => FundTransferSelfAmountScreen( fontSize: 12, color: Colors.grey[600]),
debitAccountNo: debitAccountNo, ),
creditAccount: account, // Pass the User object ],
remitterName: remitterName,
),
), ),
onTap: () {
// Navigate to the amount screen, passing the selected User object directly.
// No Beneficiary object is created.
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FundTransferSelfAmountScreen(
debitAccountNo: debitAccountNo,
creditAccount: account, // Pass the User object
remitterName: remitterName,
),
),
);
},
); );
}, },
); ),
}, IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
), ),
),
],
),
); );
} }
} }

View File

@@ -137,106 +137,122 @@ class _FundTransferSelfAmountScreenState
title: const Text("Fund Transfer"), title: const Text("Fund Transfer"),
), ),
body: SafeArea( body: SafeArea(
child: Padding( child: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: Form( Padding(
key: _formKey, padding: const EdgeInsets.all(16.0),
child: Column( child: Form(
crossAxisAlignment: CrossAxisAlignment.start, key: _formKey,
children: [ child: Column(
// Debit Account (User) crossAxisAlignment: CrossAxisAlignment.start,
Text( children: [
"Debit From", // Debit Account (User)
style: Theme.of(context).textTheme.titleSmall, Text(
), "Debit From",
Card( style: Theme.of(context).textTheme.titleSmall,
elevation: 0,
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading: Image.asset(
'assets/images/logo.png',
width: 40,
height: 40,
), ),
title: Text(widget.remitterName), Card(
subtitle: Text(widget.debitAccountNo), elevation: 0,
), margin: const EdgeInsets.symmetric(vertical: 8.0),
), child: ListTile(
const SizedBox(height: 24), leading: Image.asset(
'assets/images/logo.png',
// Credit Account (Self) width: 40,
Text( height: 40,
"Credited To", ),
style: Theme.of(context).textTheme.titleSmall, title: Text(widget.remitterName),
), subtitle: Text(widget.debitAccountNo),
Card( ),
elevation: 0,
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading: getBankLogo(
'Kangra Central Co-operative Bank', context),
title: Text(widget.creditAccount.name ?? 'N/A'),
subtitle: Text(widget.creditAccount.accountNo ?? 'N/A'),
),
),
const SizedBox(height: 24),
// Remarks
TextFormField(
controller: _remarksController,
decoration: const InputDecoration(
labelText: "Remarks (Optional)",
border: OutlineInputBorder(),
),
),
const SizedBox(height: 24),
// Amount
TextFormField(
controller: _amountController,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
labelText: "Amount",
border: OutlineInputBorder(),
prefixIcon: Icon(Icons.currency_rupee),
),
validator: (value) {
if (value == null || value.isEmpty) {
return "Amount is required";
}
if (double.tryParse(value) == null ||
double.parse(value) <= 0) {
return "Please enter a valid amount";
}
return null;
},
),
const SizedBox(height: 8),
// Daily Limit Display
if (_isLoadingLimit) const Text('Fetching daily limit...'),
if (!_isLoadingLimit && _limit != null)
Text(
'Remaining Daily Limit: ${_formatCurrency.format(_limit!.dailyLimit - _limit!.usedLimit)}',
style: Theme.of(context).textTheme.bodySmall,
),
const Spacer(),
// Proceed Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _isAmountOverLimit ? null : _onProceed,
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 16),
), ),
child: const Text("Proceed"), const SizedBox(height: 24),
),
// Credit Account (Self)
Text(
"Credited To",
style: Theme.of(context).textTheme.titleSmall,
),
Card(
elevation: 0,
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading: getBankLogo(
'Kangra Central Co-operative Bank', context),
title: Text(widget.creditAccount.name ?? 'N/A'),
subtitle: Text(widget.creditAccount.accountNo ?? 'N/A'),
),
),
const SizedBox(height: 24),
// Remarks
TextFormField(
controller: _remarksController,
decoration: const InputDecoration(
labelText: "Remarks (Optional)",
border: OutlineInputBorder(),
),
),
const SizedBox(height: 24),
// Amount
TextFormField(
controller: _amountController,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
labelText: "Amount",
border: OutlineInputBorder(),
prefixIcon: Icon(Icons.currency_rupee),
),
validator: (value) {
if (value == null || value.isEmpty) {
return "Amount is required";
}
if (double.tryParse(value) == null ||
double.parse(value) <= 0) {
return "Please enter a valid amount";
}
return null;
},
),
const SizedBox(height: 8),
// Daily Limit Display
if (_isLoadingLimit) const Text('Fetching daily limit...'),
if (!_isLoadingLimit && _limit != null)
Text(
'Remaining Daily Limit: ${_formatCurrency.format(_limit!.dailyLimit - _limit!.usedLimit)}',
style: Theme.of(context).textTheme.bodySmall,
),
const Spacer(),
// Proceed Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _isAmountOverLimit ? null : _onProceed,
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 16),
),
child: const Text("Proceed"),
),
),
const SizedBox(height: 10),
],
), ),
const SizedBox(height: 10), ),
],
), ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
), ),
); );

View File

@@ -136,7 +136,8 @@ class _TpinOtpScreenState extends State<TpinOtpScreen> {
counterText: '', counterText: '',
filled: true, filled: true,
fillColor: Colors.grey[200], fillColor: Colors.grey[200],
contentPadding: const EdgeInsets.symmetric(vertical: 16), contentPadding:
const EdgeInsets.symmetric(vertical: 16),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
borderSide: BorderSide( borderSide: BorderSide(

View File

@@ -143,6 +143,18 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
), ),
), ),
), ),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
], ],
), ),
), ),

View File

@@ -70,40 +70,56 @@ class _ChangePasswordOTPScreenState extends State<ChangePasswordOTPScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: Text(AppLocalizations.of(context).otpVerification)), appBar: AppBar(title: Text(AppLocalizations.of(context).otpVerification)),
body: Padding( body: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: _isLoading Padding(
? const Center(child: CircularProgressIndicator()) padding: const EdgeInsets.all(16.0),
: Column( child: _isLoading
crossAxisAlignment: CrossAxisAlignment.center, ? const Center(child: CircularProgressIndicator())
children: [ : Column(
Text( crossAxisAlignment: CrossAxisAlignment.center,
AppLocalizations.of(context).otpSent, children: [
textAlign: TextAlign.center, Text(
style: const TextStyle(fontSize: 16), AppLocalizations.of(context).otpSent,
), textAlign: TextAlign.center,
const SizedBox(height: 24), style: const TextStyle(fontSize: 16),
TextFormField(
controller: otpController,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).enterOTP,
border: const OutlineInputBorder(),
),
),
const SizedBox(height: 24),
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _validateOTP,
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 16),
), ),
child: Text(AppLocalizations.of(context).validateOTP), const SizedBox(height: 24),
), TextFormField(
controller: otpController,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).enterOTP,
border: const OutlineInputBorder(),
),
),
const SizedBox(height: 24),
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _validateOTP,
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 16),
),
child: Text(AppLocalizations.of(context).validateOTP),
),
),
],
), ),
], ),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
), ),
),
),
],
), ),
); );
} }

View File

@@ -90,67 +90,83 @@ class _ChangePasswordScreenState extends State<ChangePasswordScreen> {
return Scaffold( return Scaffold(
appBar: appBar:
AppBar(title: Text(AppLocalizations.of(context).changeLoginPassword)), AppBar(title: Text(AppLocalizations.of(context).changeLoginPassword)),
body: Padding( body: Stack(
padding: const EdgeInsets.all(16), children: [
child: Form( Padding(
key: _formKey, padding: const EdgeInsets.all(16),
child: Column( child: Form(
children: [ key: _formKey,
TextFormField( child: Column(
controller: currentPasswordController, children: [
obscureText: !_showCurrentPassword, TextFormField(
decoration: InputDecoration( controller: currentPasswordController,
labelText: AppLocalizations.of(context).currentpwd, obscureText: !_showCurrentPassword,
suffixIcon: IconButton( decoration: InputDecoration(
icon: Icon(_showCurrentPassword labelText: AppLocalizations.of(context).currentpwd,
? Icons.visibility suffixIcon: IconButton(
: Icons.visibility_off), icon: Icon(_showCurrentPassword
onPressed: () => setState( ? Icons.visibility
() => _showCurrentPassword = !_showCurrentPassword), : Icons.visibility_off),
onPressed: () => setState(
() => _showCurrentPassword = !_showCurrentPassword),
),
),
validator: validateCurrentPassword,
), ),
), const SizedBox(height: 16),
validator: validateCurrentPassword, TextFormField(
), controller: newPasswordController,
const SizedBox(height: 16), obscureText: !_showNewPassword,
TextFormField( decoration: InputDecoration(
controller: newPasswordController, labelText: AppLocalizations.of(context).newpwd,
obscureText: !_showNewPassword, suffixIcon: IconButton(
decoration: InputDecoration( icon: Icon(_showNewPassword
labelText: AppLocalizations.of(context).newpwd, ? Icons.visibility
suffixIcon: IconButton( : Icons.visibility_off),
icon: Icon(_showNewPassword onPressed: () => setState(
? Icons.visibility () => _showNewPassword = !_showNewPassword),
: Icons.visibility_off), ),
onPressed: () => ),
setState(() => _showNewPassword = !_showNewPassword), validator: validateNewPassword,
), ),
), const SizedBox(height: 16),
validator: validateNewPassword, TextFormField(
), controller: confirmPasswordController,
const SizedBox(height: 16), obscureText: !_showConfirmPassword,
TextFormField( decoration: InputDecoration(
controller: confirmPasswordController, labelText: AppLocalizations.of(context).confirmpwd,
obscureText: !_showConfirmPassword, suffixIcon: IconButton(
decoration: InputDecoration( icon: Icon(_showConfirmPassword
labelText: AppLocalizations.of(context).confirmpwd, ? Icons.visibility
suffixIcon: IconButton( : Icons.visibility_off),
icon: Icon(_showConfirmPassword onPressed: () => setState(
? Icons.visibility () => _showConfirmPassword = !_showConfirmPassword),
: Icons.visibility_off), ),
onPressed: () => setState( ),
() => _showConfirmPassword = !_showConfirmPassword), validator: validateConfirmPassword,
), ),
), const SizedBox(height: 24),
validator: validateConfirmPassword, ElevatedButton(
onPressed: _proceed,
child: Text(AppLocalizations.of(context).proceed),
),
],
), ),
const SizedBox(height: 24), ),
ElevatedButton(
onPressed: _proceed,
child: Text(AppLocalizations.of(context).proceed),
),
],
), ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
); );
} }

View File

@@ -20,43 +20,59 @@ class PreferenceScreen extends StatelessWidget {
), ),
body: BlocBuilder<ThemeCubit, ThemeState>( body: BlocBuilder<ThemeCubit, ThemeState>(
builder: (context, state) { builder: (context, state) {
return ListView( return Stack(
children: [ children: [
//Set Prefered Username ListView(
// ListTile( children: [
// leading: const Icon(Icons.person), //Set Prefered Username
// title: const Text("Set Prefered Username"), // ListTile(
// onTap: () { // leading: const Icon(Icons.person),
// }), // title: const Text("Set Prefered Username"),
// Language Selection // onTap: () {
ListTile( // }),
leading: const Icon(Icons.language), // Language Selection
title: Text(loc.language), ListTile(
onTap: () { leading: const Icon(Icons.language),
showDialog( title: Text(loc.language),
context: context, onTap: () {
builder: (_) => const LanguageDialog(), showDialog(
); context: context,
}, builder: (_) => const LanguageDialog(),
);
},
),
//Theme Mode Switch (Light/Dark)
ListTile(
leading: const Icon(Icons.brightness_6),
title: Text(AppLocalizations.of(context).themeMode),
onTap: () {
showThemeModeDialog(context);
},
),
//Color_Theme_Selection
ListTile(
leading: const Icon(Icons.color_lens),
title: Text(AppLocalizations.of(context).themeColor),
onTap: () {
showDialog(
context: context,
builder: (_) => const ColorThemeDialog(),
);
}),
],
), ),
//Theme Mode Switch (Light/Dark) IgnorePointer(
ListTile( child: Center(
leading: const Icon(Icons.brightness_6), child: Opacity(
title: Text(AppLocalizations.of(context).themeMode), opacity: 0.1, // Low opacity
onTap: () { child: Image.asset(
showThemeModeDialog(context); 'assets/images/logo.png',
}, width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
), ),
//Color_Theme_Selection
ListTile(
leading: const Icon(Icons.color_lens),
title: Text(AppLocalizations.of(context).themeColor),
onTap: () {
showDialog(
context: context,
builder: (_) => const ColorThemeDialog(),
);
}),
], ],
); );
}, },

View File

@@ -60,7 +60,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
if (mounted) { if (mounted) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text(AppLocalizations.of(context).biometricsNotAvailable)), content:
Text(AppLocalizations.of(context).biometricsNotAvailable)),
); );
} }
return; return;
@@ -164,118 +165,137 @@ class _ProfileScreenState extends State<ProfileScreen> {
appBar: AppBar( appBar: AppBar(
title: Text(loc.profile), // Localized "Profile" title: Text(loc.profile), // Localized "Profile"
), ),
body: ListView( body: Stack(
children: [ children: [
ListTile( ListView(
leading: const Icon(Icons.settings), children: [
title: Text(loc.preferences), ListTile(
onTap: () { leading: const Icon(Icons.settings),
Navigator.push( title: Text(loc.preferences),
context, trailing: const Icon(Icons.chevron_right),
MaterialPageRoute( onTap: () {
builder: (context) => const PreferenceScreen()), Navigator.push(
); context,
}, MaterialPageRoute(
), builder: (context) => const PreferenceScreen()),
ListTile(
leading: const Icon(Icons.currency_rupee),
title: Text(AppLocalizations.of(context).dailylimit),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DailyLimitScreen()),
);
},
),
SwitchListTile(
title: Text(AppLocalizations.of(context).enableFingerprintLogin),
value: _isBiometricEnabled,
onChanged: (bool value) {
// The state is now managed within _handleBiometricToggle
_handleBiometricToggle(value);
},
secondary: const Icon(Icons.fingerprint),
),
ListTile(
leading: const Icon(Icons.security),
title: Text(loc.securitySettings),
trailing: const Icon(Icons.chevron_right),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SecuritySettingsScreen(
mobileNumber: widget.mobileNumber,
),
),
);
},
),
ListTile(
leading: const Icon(Icons.smartphone),
title: const Text("App Version"),
trailing: FutureBuilder<String>(
future: _getAppVersion(),
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
// Show a loading indicator while waiting for the future to complete
return const CircularProgressIndicator();
} else if (snapshot.hasError) {
return const Text("Error");
} else {
// Display the version number once the future is complete
return Text(
snapshot.data ?? "N/A",
selectionColor: const Color(0xFFFFFFFF),
); );
} },
}, ),
), ListTile(
), leading: const Icon(Icons.security),
ListTile( title: Text(loc.securitySettings),
leading: const Icon(Icons.exit_to_app), trailing: const Icon(Icons.chevron_right),
title: Text(AppLocalizations.of(context).logout), onTap: () {
onTap: () async { Navigator.push(
final shouldExit = await showDialog<bool>( context,
context: context, MaterialPageRoute(
builder: (context) => AlertDialog( builder: (context) => SecuritySettingsScreen(
title: Text(AppLocalizations.of(context).logout), mobileNumber: widget.mobileNumber,
content: Text(AppLocalizations.of(context).logoutCheck), ),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: Text(AppLocalizations.of(context).no),
), ),
TextButton( );
onPressed: () => Navigator.of(context).pop(true), },
child: Text(AppLocalizations.of(context).yes), ),
), ListTile(
], leading: const Icon(Icons.currency_rupee),
title: Text(AppLocalizations.of(context).dailylimit),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DailyLimitScreen()),
);
},
),
SwitchListTile(
title:
Text(AppLocalizations.of(context).enableFingerprintLogin),
value: _isBiometricEnabled,
onChanged: (bool value) {
// The state is now managed within _handleBiometricToggle
_handleBiometricToggle(value);
},
secondary: const Icon(Icons.fingerprint),
),
ListTile(
leading: const Icon(Icons.smartphone),
title: const Text("App Version"),
trailing: FutureBuilder<String>(
future: _getAppVersion(),
builder:
(BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
// Show a loading indicator while waiting for the future to complete
return const CircularProgressIndicator();
} else if (snapshot.hasError) {
return const Text("Error");
} else {
// Display the version number once the future is complete
return Text(
snapshot.data ?? "N/A",
selectionColor: const Color(0xFFFFFFFF),
);
}
},
), ),
); ),
ListTile(
leading: const Icon(Icons.exit_to_app),
title: Text(AppLocalizations.of(context).logout),
onTap: () async {
final shouldExit = await showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title: Text(AppLocalizations.of(context).logout),
content: Text(AppLocalizations.of(context).logoutCheck),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: Text(AppLocalizations.of(context).no),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
child: Text(AppLocalizations.of(context).yes),
),
],
),
);
if (shouldExit == true) { if (shouldExit == true) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
SystemNavigator.pop(); SystemNavigator.pop();
} }
exit(0); exit(0);
} }
}, },
),
ListTile(
leading: const Icon(Icons.logout),
title: Text(AppLocalizations.of(context).deregister),
onTap: () async {
final shouldLogout = await showDialog<bool>(
context: context,
builder: (_) => const LogoutDialog(),
);
if (shouldLogout == true) {
await _handleLogout(context);
}
},
),
],
), ),
ListTile( IgnorePointer(
leading: const Icon(Icons.logout), child: Center(
title: Text(AppLocalizations.of(context).deregister), child: Opacity(
onTap: () async { opacity: 0.1, // Low opacity
final shouldLogout = await showDialog<bool>( child: Image.asset(
context: context, 'assets/images/logo.png',
builder: (_) => const LogoutDialog(), width: 200, // Adjust size as needed
); height: 200, // Adjust size as needed
),
if (shouldLogout == true) { ),
await _handleLogout(context); ),
}
},
), ),
], ],
), ),

View File

@@ -21,98 +21,115 @@ class SecuritySettingsScreen extends StatelessWidget {
title: Text(loc.securitySettings), title: Text(loc.securitySettings),
centerTitle: true, centerTitle: true,
), ),
body: ListView( body: Stack(
children: [ children: [
ListTile( ListView(
leading: const Icon(Icons.lock_outline), children: [
title: Text(loc.changeLoginPassword), ListTile(
trailing: const Icon(Icons.chevron_right), leading: const Icon(Icons.lock_outline),
onTap: () { title: Text(loc.changeLoginPassword),
Navigator.push( trailing: const Icon(Icons.chevron_right),
context, onTap: () {
MaterialPageRoute( Navigator.push(
builder: (context) => ChangePasswordScreen( context,
mobileNumber: mobileNumber,
),
),
);
},
),
const Divider(height: 1),
ListTile(
leading: const Icon(Icons.pin),
title: Text(loc.changeMpin),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ChangeMpinScreen(),
),
);
if (result == true && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(loc.mpinChangedSuccessfully),
backgroundColor: Colors.green,
),
);
}
},
),
const Divider(height: 1),
ListTile(
leading: const Icon(Icons.password),
title: const Text('Change TPIN'),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final authService = getIt<AuthService>();
final isTpinSet = await authService.checkTpin();
if (!isTpinSet) {
if (context.mounted) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('TPIN Not Set'),
content: const Text(
'You have not set a TPIN yet. Please set a TPIN to proceed.'),
actions: <Widget>[
TextButton(
child: const Text('Back'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('Proceed'),
onPressed: () {
Navigator.of(context).pop();
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const TpinSetScreen(),
),
);
},
),
],
);
},
);
}
} else {
if (context.mounted) {
Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => ChangePasswordScreen(
ChangeTpinScreen(mobileNumber: mobileNumber), mobileNumber: mobileNumber,
),
), ),
); );
} },
} ),
}, const Divider(height: 1),
ListTile(
leading: const Icon(Icons.pin),
title: Text(loc.changeMpin),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ChangeMpinScreen(),
),
);
if (result == true && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(loc.mpinChangedSuccessfully),
backgroundColor: Colors.green,
),
);
}
},
),
const Divider(height: 1),
ListTile(
leading: const Icon(Icons.password),
title: const Text('Change TPIN'),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final authService = getIt<AuthService>();
final isTpinSet = await authService.checkTpin();
if (!isTpinSet) {
if (context.mounted) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('TPIN Not Set'),
content: const Text(
'You have not set a TPIN yet. Please set a TPIN to proceed.'),
actions: <Widget>[
TextButton(
child: const Text('Back'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('Proceed'),
onPressed: () {
Navigator.of(context).pop();
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
const TpinSetScreen(),
),
);
},
),
],
);
},
);
}
} else {
if (context.mounted) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
ChangeTpinScreen(mobileNumber: mobileNumber),
),
);
}
}
},
),
],
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
), ),
], ],
), ),

View File

@@ -458,329 +458,117 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: Padding( body: Stack(
padding: const EdgeInsets.all(12), children: [
child: Form( Padding(
key: _formKey, padding: const EdgeInsets.all(12),
child: ListView( child: Form(
children: [ key: _formKey,
const SizedBox(height: 10), child: ListView(
Text(
AppLocalizations.of(context).debitFrom,
style: Theme.of(context).textTheme.titleSmall,
),
Card(
elevation: 0,
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading: Image.asset(
'assets/images/logo.png',
width: 40,
height: 40,
),
title: Text(widget.debitAccount),
subtitle: Text(AppLocalizations.of(context).ownBank),
),
),
const SizedBox(height: 24),
TextFormField(
decoration: InputDecoration(
labelText: AppLocalizations.of(context).accountNumber,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary, width: 2),
),
),
controller: accountNumberController,
keyboardType: TextInputType.number,
obscureText: true,
textInputAction: TextInputAction.next,
onChanged: (value) {
nameController.clear();
setState(() {
_isBeneficiaryValidated = false;
});
},
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).accountNumberRequired;
} else if (value.length < 7 || value.length > 20) {
return AppLocalizations.of(context).accno7to20;
}
return null;
},
),
const SizedBox(height: 24),
TextFormField(
controller: confirmAccountNumberController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).confirmAccountNumber,
// prefixIcon: Icon(Icons.person),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary, width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).reenterAccountNumber;
}
if (value != accountNumberController.text) {
return AppLocalizations.of(context).accountMismatch;
}
return null;
},
),
const SizedBox(height: 25),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( const SizedBox(height: 10),
child: TextFormField( Text(
focusNode: _ifscFocusNode, AppLocalizations.of(context).debitFrom,
maxLength: 11, style: Theme.of(context).textTheme.titleSmall,
inputFormatters: [ ),
LengthLimitingTextInputFormatter(11), Card(
], elevation: 0,
decoration: InputDecoration( margin: const EdgeInsets.symmetric(vertical: 8.0),
labelText: AppLocalizations.of(context).ifscCode, child: ListTile(
border: const OutlineInputBorder(), leading: Image.asset(
isDense: true, 'assets/images/logo.png',
filled: true, width: 40,
fillColor: Theme.of(context).scaffoldBackgroundColor, height: 40,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
), ),
controller: ifscController, title: Text(widget.debitAccount),
textInputAction: TextInputAction.next, subtitle: Text(AppLocalizations.of(context).ownBank),
onChanged: (value) {
setState(() {
final trimmed = value.trim().toUpperCase();
if (trimmed.length < 11) {
// clear bank/branch if backspace or changed
bankNameController.clear();
branchNameController.clear();
}
});
},
validator: (value) {
final pattern = RegExp(r'^[A-Z]{4}0[A-Z0-9]{6}$');
if (value == null || value.trim().isEmpty) {
return AppLocalizations.of(context).enterIfsc;
} else if (!pattern.hasMatch(
value.trim().toUpperCase(),
)) {
return AppLocalizations.of(
context,
).invalidIfscFormat;
}
return null;
},
), ),
), ),
const SizedBox( const SizedBox(height: 24),
width: 10, TextFormField(
), decoration: InputDecoration(
Expanded( labelText: AppLocalizations.of(context).accountNumber,
child: DropdownButtonFormField<String>( border: const OutlineInputBorder(),
value: accountType, isDense: true,
decoration: InputDecoration( filled: true,
labelText: AppLocalizations.of(context).accountType, fillColor: Theme.of(context).scaffoldBackgroundColor,
border: const OutlineInputBorder(), enabledBorder: OutlineInputBorder(
isDense: true, borderSide: BorderSide(
filled: true, color: Theme.of(context).colorScheme.outline),
fillColor: Theme.of(context).scaffoldBackgroundColor, ),
enabledBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline), color: Theme.of(context).colorScheme.primary,
), width: 2),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
), ),
items: [
'Savings',
'Current',
]
.map(
(e) => DropdownMenuItem(value: e, child: Text(e)),
)
.toList(),
onChanged: (value) => setState(() {
accountType = value!;
}),
), ),
controller: accountNumberController,
keyboardType: TextInputType.number,
obscureText: true,
textInputAction: TextInputAction.next,
onChanged: (value) {
nameController.clear();
setState(() {
_isBeneficiaryValidated = false;
});
},
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context)
.accountNumberRequired;
} else if (value.length < 7 || value.length > 20) {
return AppLocalizations.of(context).accno7to20;
}
return null;
},
), ),
], const SizedBox(height: 24),
), TextFormField(
const SizedBox(height: 25), controller: confirmAccountNumberController,
TextFormField( decoration: InputDecoration(
controller: bankNameController, labelText:
enabled: false, AppLocalizations.of(context).confirmAccountNumber,
decoration: InputDecoration( // prefixIcon: Icon(Icons.person),
labelText: AppLocalizations.of(context).bankName, border: const OutlineInputBorder(),
border: const OutlineInputBorder(), isDense: true,
isDense: true, filled: true,
filled: true, fillColor: Theme.of(context).scaffoldBackgroundColor,
fillColor: Theme.of(context).dialogBackgroundColor, enabledBorder: OutlineInputBorder(
enabledBorder: OutlineInputBorder( borderSide: BorderSide(
borderSide: BorderSide( color: Theme.of(context).colorScheme.outline),
color: Theme.of(context).colorScheme.outline), ),
), focusedBorder: OutlineInputBorder(
focusedBorder: OutlineInputBorder( borderSide: BorderSide(
borderSide: BorderSide( color: Theme.of(context).colorScheme.primary,
color: Theme.of(context).colorScheme.primary, width: 2), width: 2),
), ),
),
),
const SizedBox(height: 25),
TextFormField(
controller: branchNameController,
enabled: false,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).branchName,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2,
), ),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context)
.reenterAccountNumber;
}
if (value != accountNumberController.text) {
return AppLocalizations.of(context).accountMismatch;
}
return null;
},
), ),
), const SizedBox(height: 25),
),
const SizedBox(height: 24),
if (!_isBeneficiaryValidated)
Padding(
padding: const EdgeInsets.only(bottom: 24),
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed:
_isValidating || ifscController.text.length != 11
? null
: () {
if (confirmAccountNumberController.text ==
accountNumberController.text) {
_validateBeneficiary();
} else {
setState(() {
_validationError =
AppLocalizations.of(context)
.accountMismatch;
});
}
},
child: _isValidating
? const SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(strokeWidth: 2),
)
: Text(
AppLocalizations.of(context).validateBeneficiary),
),
),
),
if (_validationError != null)
Padding(
padding: const EdgeInsets.only(bottom: 24.0),
child: Text(
_validationError!,
style:
TextStyle(color: Theme.of(context).colorScheme.error),
),
),
TextFormField(
controller: nameController,
enabled: false,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).name,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary, width: 2),
),
),
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).nameRequired;
}
return null;
},
),
const SizedBox(height: 25),
TextFormField(
controller: remarksController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).remarks,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary, width: 2),
),
),
),
const SizedBox(height: 25),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: TextFormField( child: TextFormField(
controller: phoneController, focusNode: _ifscFocusNode,
keyboardType: TextInputType.phone, maxLength: 11,
inputFormatters: [
LengthLimitingTextInputFormatter(11),
],
decoration: InputDecoration( decoration: InputDecoration(
labelText: AppLocalizations.of(context).phone, labelText: AppLocalizations.of(context).ifscCode,
prefixIcon: const Icon(Icons.phone),
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true, filled: true,
@@ -796,109 +584,360 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
width: 2), width: 2),
), ),
), ),
controller: ifscController,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
validator: (value) => value == null || value.isEmpty onChanged: (value) {
? AppLocalizations.of(context).phoneRequired setState(() {
: null, final trimmed = value.trim().toUpperCase();
), if (trimmed.length < 11) {
), // clear bank/branch if backspace or changed
const SizedBox(width: 10), bankNameController.clear();
Expanded( branchNameController.clear();
child: TextFormField( }
decoration: InputDecoration( });
labelText: AppLocalizations.of(context).amount, },
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
controller: amountController,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) { validator: (value) {
if (value == null || value.isEmpty) { final pattern = RegExp(r'^[A-Z]{4}0[A-Z0-9]{6}$');
return AppLocalizations.of(context) if (value == null || value.trim().isEmpty) {
.amountRequired; return AppLocalizations.of(context).enterIfsc;
} } else if (!pattern.hasMatch(
final amount = double.tryParse(value); value.trim().toUpperCase(),
if (amount == null || amount <= 0) { )) {
return AppLocalizations.of(context).validAmount; return AppLocalizations.of(
context,
).invalidIfscFormat;
} }
return null; return null;
}, },
), ),
), ),
const SizedBox(
width: 10,
),
Expanded(
child: DropdownButtonFormField<String>(
value: accountType,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).accountType,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
items: [
'Savings',
'Current',
]
.map(
(e) =>
DropdownMenuItem(value: e, child: Text(e)),
)
.toList(),
onChanged: (value) => setState(() {
accountType = value!;
}),
),
),
], ],
), ),
const SizedBox(height: 25),
TextFormField(
controller: bankNameController,
enabled: false,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).bankName,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
),
const SizedBox(height: 25),
TextFormField(
controller: branchNameController,
enabled: false,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).branchName,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2,
),
),
),
),
const SizedBox(height: 24),
if (!_isBeneficiaryValidated)
Padding(
padding: const EdgeInsets.only(bottom: 24),
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed:
_isValidating || ifscController.text.length != 11
? null
: () {
if (confirmAccountNumberController.text ==
accountNumberController.text) {
_validateBeneficiary();
} else {
setState(() {
_validationError =
AppLocalizations.of(context)
.accountMismatch;
});
}
},
child: _isValidating
? const SizedBox(
width: 20,
height: 20,
child:
CircularProgressIndicator(strokeWidth: 2),
)
: Text(AppLocalizations.of(context)
.validateBeneficiary),
),
),
),
if (_validationError != null)
Padding(
padding: const EdgeInsets.only(bottom: 24.0),
child: Text(
_validationError!,
style: TextStyle(
color: Theme.of(context).colorScheme.error),
),
),
TextFormField(
controller: nameController,
enabled: false,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).name,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).nameRequired;
}
return null;
},
),
const SizedBox(height: 25),
TextFormField(
controller: remarksController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).remarks,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
),
const SizedBox(height: 25),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: TextFormField(
controller: phoneController,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).phone,
prefixIcon: const Icon(Icons.phone),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context)
.colorScheme
.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color:
Theme.of(context).colorScheme.primary,
width: 2),
),
),
textInputAction: TextInputAction.next,
validator: (value) => value == null ||
value.isEmpty
? AppLocalizations.of(context).phoneRequired
: null,
),
),
const SizedBox(width: 10),
Expanded(
child: TextFormField(
decoration: InputDecoration(
labelText: AppLocalizations.of(context).amount,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context)
.colorScheme
.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color:
Theme.of(context).colorScheme.primary,
width: 2),
),
),
controller: amountController,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context)
.amountRequired;
}
final amount = double.tryParse(value);
if (amount == null || amount <= 0) {
return AppLocalizations.of(context)
.validAmount;
}
return null;
},
),
),
],
),
],
),
const SizedBox(height: 8),
if (_isLoadingLimit)
const Padding(
padding: EdgeInsets.only(left: 8.0),
child: Text('Fetching daily limit...'),
),
if (!_isLoadingLimit && _limit != null)
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
'Remaining Daily Limit: ${_formatCurrency.format(_limit!.dailyLimit - _limit!.usedLimit)}',
style: Theme.of(context).textTheme.bodySmall,
),
),
const SizedBox(height: 30),
Row(
children: [
Text(
AppLocalizations.of(context).transactionMode,
style: const TextStyle(fontWeight: FontWeight.w500),
),
const SizedBox(width: 12),
Expanded(child: buildTransactionModeSelector()),
],
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SwipeButton.expand(
thumb: Icon(Icons.arrow_forward,
color: _isAmountOverLimit
? Colors.grey
: Theme.of(context).dialogBackgroundColor),
activeThumbColor: _isAmountOverLimit
? Colors.grey.shade700
: Theme.of(context).colorScheme.primary,
activeTrackColor: _isAmountOverLimit
? Colors.grey.shade300
: Theme.of(context)
.colorScheme
.secondary
.withAlpha(100),
borderRadius: BorderRadius.circular(30),
height: 56,
onSwipe: () {
if (_isAmountOverLimit) {
return; // Do nothing if amount is over the limit
}
_onProceedToPay();
},
child: Text(
AppLocalizations.of(context).swipeToPay,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
),
),
], ],
), ),
const SizedBox(height: 8), ),
if (_isLoadingLimit)
const Padding(
padding: EdgeInsets.only(left: 8.0),
child: Text('Fetching daily limit...'),
),
if (!_isLoadingLimit && _limit != null)
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
'Remaining Daily Limit: ${_formatCurrency.format(_limit!.dailyLimit - _limit!.usedLimit)}',
style: Theme.of(context).textTheme.bodySmall,
),
),
const SizedBox(height: 30),
Row(
children: [
Text(
AppLocalizations.of(context).transactionMode,
style: const TextStyle(fontWeight: FontWeight.w500),
),
const SizedBox(width: 12),
Expanded(child: buildTransactionModeSelector()),
],
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SwipeButton.expand(
thumb: Icon(Icons.arrow_forward,
color: _isAmountOverLimit
? Colors.grey
: Theme.of(context).dialogBackgroundColor),
activeThumbColor: _isAmountOverLimit
? Colors.grey.shade700
: Theme.of(context).colorScheme.primary,
activeTrackColor: _isAmountOverLimit
? Colors.grey.shade300
: Theme.of(context).colorScheme.secondary.withAlpha(100),
borderRadius: BorderRadius.circular(30),
height: 56,
onSwipe: () {
if (_isAmountOverLimit) {
return; // Do nothing if amount is over the limit
}
_onProceedToPay();
},
child: Text(
AppLocalizations.of(context).swipeToPay,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
),
),
],
), ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
); );
} }

View File

@@ -21,38 +21,54 @@ class _QuickPayScreen extends State<QuickPayScreen> {
AppLocalizations.of(context).quickPay.replaceAll('\n', ''), AppLocalizations.of(context).quickPay.replaceAll('\n', ''),
), ),
), ),
body: ListView( body: Stack(
children: [ children: [
QuickPayManagementTile( ListView(
icon: Symbols.input_circle, children: [
label: AppLocalizations.of(context).ownBank, QuickPayManagementTile(
onTap: () { icon: Symbols.input_circle,
Navigator.push( label: AppLocalizations.of(context).ownBank,
context, onTap: () {
MaterialPageRoute( Navigator.push(
builder: (context) => QuickPayWithinBankScreen( context,
debitAccount: widget.debitAccount, MaterialPageRoute(
), builder: (context) => QuickPayWithinBankScreen(
), debitAccount: widget.debitAccount,
); ),
}, ),
);
},
),
const Divider(height: 1),
QuickPayManagementTile(
icon: Symbols.output_circle,
label: AppLocalizations.of(context).outsideBank,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => QuickPayOutsideBankScreen(
debitAccount: widget.debitAccount,
),
),
);
},
),
const Divider(height: 1),
],
), ),
const Divider(height: 1), IgnorePointer(
QuickPayManagementTile( child: Center(
icon: Symbols.output_circle, child: Opacity(
label: AppLocalizations.of(context).outsideBank, opacity: 0.1, // Low opacity
onTap: () { child: Image.asset(
Navigator.push( 'assets/images/logo.png',
context, width: 200, // Adjust size as needed
MaterialPageRoute( height: 200, // Adjust size as needed
builder: (context) => QuickPayOutsideBankScreen(
debitAccount: widget.debitAccount,
),
), ),
); ),
}, ),
), ),
const Divider(height: 1),
], ],
), ),
); );

View File

@@ -149,321 +149,348 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: Padding( body: Stack(
padding: const EdgeInsets.all(16.0), children: [
child: Form( Padding(
key: _formKey, padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView( child: Form(
child: Column( key: _formKey,
children: [ child: SingleChildScrollView(
const SizedBox(height: 10), child: Column(
TextFormField( children: [
decoration: InputDecoration( const SizedBox(height: 10),
labelText: AppLocalizations.of(context).debitAccountNumber, TextFormField(
border: const OutlineInputBorder(), decoration: InputDecoration(
isDense: true, labelText:
filled: true, AppLocalizations.of(context).debitAccountNumber,
fillColor: Theme.of(context).scaffoldBackgroundColor, border: const OutlineInputBorder(),
), isDense: true,
readOnly: true, filled: true,
controller: TextEditingController(text: widget.debitAccount), fillColor: Theme.of(context).scaffoldBackgroundColor,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
enabled: false,
),
const SizedBox(height: 20),
TextFormField(
decoration: InputDecoration(
labelText: AppLocalizations.of(context).accountNumber,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
controller: accountNumberController,
keyboardType: TextInputType.number,
obscureText: true,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).accountNumberRequired;
} else if (value.length != 11) {
return AppLocalizations.of(context).validAccountNumber;
}
return null;
},
),
const SizedBox(height: 25),
TextFormField(
controller: confirmAccountNumberController,
decoration: InputDecoration(
labelText:
AppLocalizations.of(context).confirmAccountNumber,
// prefixIcon: Icon(Icons.person),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).reenterAccountNumber;
}
if (value != accountNumberController.text) {
return AppLocalizations.of(context).accountMismatch;
}
return null;
},
),
if (!_isBeneficiaryValidated)
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _isValidating
? null
: () {
if (accountNumberController.text.length == 11 &&
confirmAccountNumberController.text ==
accountNumberController.text) {
_validateBeneficiary();
} else {
setState(() {
_validationError =
AppLocalizations.of(context)
.accountMismatch;
});
}
},
child: _isValidating
? const SizedBox(
width: 20,
height: 20,
child:
CircularProgressIndicator(strokeWidth: 2),
)
: Text(AppLocalizations.of(context)
.validateBeneficiary),
), ),
readOnly: true,
controller:
TextEditingController(text: widget.debitAccount),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
enabled: false,
), ),
), const SizedBox(height: 20),
if (_beneficiaryName != null && _isBeneficiaryValidated) TextFormField(
Padding( decoration: InputDecoration(
padding: const EdgeInsets.only(top: 12.0), labelText: AppLocalizations.of(context).accountNumber,
child: Row( border: const OutlineInputBorder(),
children: [ isDense: true,
const Icon(Icons.check_circle, color: Colors.green), filled: true,
const SizedBox(width: 8), fillColor: Theme.of(context).scaffoldBackgroundColor,
Text( enabledBorder: OutlineInputBorder(
'${AppLocalizations.of(context).beneficiaryName}: $_beneficiaryName', borderSide: BorderSide(
style: const TextStyle( color: Theme.of(context).colorScheme.outline),
color: Colors.green, fontWeight: FontWeight.bold), ),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
controller: accountNumberController,
keyboardType: TextInputType.number,
obscureText: true,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context)
.accountNumberRequired;
} else if (value.length != 11) {
return AppLocalizations.of(context)
.validAccountNumber;
}
return null;
},
),
const SizedBox(height: 25),
TextFormField(
controller: confirmAccountNumberController,
decoration: InputDecoration(
labelText:
AppLocalizations.of(context).confirmAccountNumber,
// prefixIcon: Icon(Icons.person),
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context)
.reenterAccountNumber;
}
if (value != accountNumberController.text) {
return AppLocalizations.of(context).accountMismatch;
}
return null;
},
),
if (!_isBeneficiaryValidated)
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _isValidating
? null
: () {
if (accountNumberController.text.length ==
11 &&
confirmAccountNumberController.text ==
accountNumberController.text) {
_validateBeneficiary();
} else {
setState(() {
_validationError =
AppLocalizations.of(context)
.accountMismatch;
});
}
},
child: _isValidating
? const SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(
strokeWidth: 2),
)
: Text(AppLocalizations.of(context)
.validateBeneficiary),
),
),
),
if (_beneficiaryName != null && _isBeneficiaryValidated)
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Row(
children: [
const Icon(Icons.check_circle, color: Colors.green),
const SizedBox(width: 8),
Text(
'${AppLocalizations.of(context).beneficiaryName}: $_beneficiaryName',
style: const TextStyle(
color: Colors.green,
fontWeight: FontWeight.bold),
),
],
),
),
if (_validationError != null)
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
_validationError!,
style: const TextStyle(color: Colors.red),
),
),
const SizedBox(height: 24),
DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: AppLocalizations.of(
context,
).beneficiaryAccountType,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
value: _selectedAccountType,
items: [
DropdownMenuItem(
value: 'SB',
child: Text(AppLocalizations.of(context).savings),
),
DropdownMenuItem(
value: 'LN',
child: Text(AppLocalizations.of(context).loan),
), ),
], ],
onChanged: (value) {
setState(() {
_selectedAccountType = value;
});
},
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).selectAccountType;
}
return null;
},
), ),
), const SizedBox(height: 25),
if (_validationError != null) TextFormField(
Padding( controller: remarksController,
padding: const EdgeInsets.only(top: 8.0), decoration: InputDecoration(
child: Text( labelText: AppLocalizations.of(context).remarks,
_validationError!, border: const OutlineInputBorder(),
style: const TextStyle(color: Colors.red), isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
), ),
), const SizedBox(height: 25),
const SizedBox(height: 24), TextFormField(
DropdownButtonFormField<String>( decoration: InputDecoration(
decoration: InputDecoration( labelText: AppLocalizations.of(context).amount,
labelText: AppLocalizations.of( border: const OutlineInputBorder(),
context, isDense: true,
).beneficiaryAccountType, filled: true,
border: const OutlineInputBorder(), fillColor: Theme.of(context).scaffoldBackgroundColor,
isDense: true, enabledBorder: OutlineInputBorder(
filled: true, borderSide: BorderSide(
fillColor: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).colorScheme.outline),
enabledBorder: OutlineInputBorder( ),
borderSide: BorderSide( focusedBorder: OutlineInputBorder(
color: Theme.of(context).colorScheme.outline), borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
controller: amountController,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).amountRequired;
}
final amount = double.tryParse(value);
if (amount == null || amount <= 0) {
return AppLocalizations.of(context).validAmount;
}
return null;
},
), ),
focusedBorder: OutlineInputBorder( const SizedBox(height: 8),
borderSide: BorderSide( if (_isLoadingLimit) const Text('Fetching daily limit...'),
color: Theme.of(context).colorScheme.primary, if (!_isLoadingLimit && _limit != null)
width: 2), Text(
), 'Remaining Daily Limit: ${_formatCurrency.format(_limit!.dailyLimit - _limit!.usedLimit)}',
), style: Theme.of(context).textTheme.bodySmall,
value: _selectedAccountType, ),
items: [ const SizedBox(height: 45),
DropdownMenuItem( Align(
value: 'SB', alignment: Alignment.center,
child: Text(AppLocalizations.of(context).savings), child: SwipeButton.expand(
), thumb: Icon(Icons.arrow_forward,
DropdownMenuItem( color: _isAmountOverLimit
value: 'LN', ? Colors.grey
child: Text(AppLocalizations.of(context).loan), : Theme.of(context).dialogBackgroundColor),
activeThumbColor: _isAmountOverLimit
? Colors.grey.shade700
: Theme.of(context).colorScheme.primary,
activeTrackColor: _isAmountOverLimit
? Colors.grey.shade300
: Theme.of(
context,
).colorScheme.secondary.withAlpha(100),
borderRadius: BorderRadius.circular(30),
height: 56,
child: Text(
AppLocalizations.of(context).swipeToPay,
style: const TextStyle(fontSize: 16),
),
onSwipe: () {
if (_isAmountOverLimit) {
return; // Do nothing if amount is over limit
}
if (_formKey.currentState!.validate()) {
if (!_isBeneficiaryValidated) {
setState(() {
_validationError = AppLocalizations.of(context)
.validateBeneficiaryproceeding;
});
return;
}
// Perform payment logic
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TransactionPinScreen(
onPinCompleted:
(pinScreenContext, tpin) async {
final transfer = Transfer(
fromAccount: widget.debitAccount,
toAccount: accountNumberController.text,
toAccountType: _selectedAccountType!,
amount: amountController.text,
tpin: tpin,
remarks: remarksController.text,
);
final paymentService =
getIt<PaymentService>();
final paymentResponseFuture = paymentService
.processQuickPayWithinBank(transfer);
Navigator.of(pinScreenContext)
.pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse:
paymentResponseFuture),
),
);
},
),
),
);
}
},
),
), ),
], ],
onChanged: (value) {
setState(() {
_selectedAccountType = value;
});
},
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).selectAccountType;
}
return null;
},
), ),
const SizedBox(height: 25), ),
TextFormField(
controller: remarksController,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).remarks,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
),
const SizedBox(height: 25),
TextFormField(
decoration: InputDecoration(
labelText: AppLocalizations.of(context).amount,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary,
width: 2),
),
),
controller: amountController,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).amountRequired;
}
final amount = double.tryParse(value);
if (amount == null || amount <= 0) {
return AppLocalizations.of(context).validAmount;
}
return null;
},
),
const SizedBox(height: 8),
if (_isLoadingLimit) const Text('Fetching daily limit...'),
if (!_isLoadingLimit && _limit != null)
Text(
'Remaining Daily Limit: ${_formatCurrency.format(_limit!.dailyLimit - _limit!.usedLimit)}',
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 45),
Align(
alignment: Alignment.center,
child: SwipeButton.expand(
thumb: Icon(Icons.arrow_forward,
color: _isAmountOverLimit
? Colors.grey
: Theme.of(context).dialogBackgroundColor),
activeThumbColor: _isAmountOverLimit
? Colors.grey.shade700
: Theme.of(context).colorScheme.primary,
activeTrackColor: _isAmountOverLimit
? Colors.grey.shade300
: Theme.of(
context,
).colorScheme.secondary.withAlpha(100),
borderRadius: BorderRadius.circular(30),
height: 56,
child: Text(
AppLocalizations.of(context).swipeToPay,
style: const TextStyle(fontSize: 16),
),
onSwipe: () {
if (_isAmountOverLimit) {
return; // Do nothing if amount is over limit
}
if (_formKey.currentState!.validate()) {
if (!_isBeneficiaryValidated) {
setState(() {
_validationError = AppLocalizations.of(context)
.validateBeneficiaryproceeding;
});
return;
}
// Perform payment logic
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TransactionPinScreen(
onPinCompleted: (pinScreenContext, tpin) async {
final transfer = Transfer(
fromAccount: widget.debitAccount,
toAccount: accountNumberController.text,
toAccountType: _selectedAccountType!,
amount: amountController.text,
tpin: tpin,
remarks: remarksController.text,
);
final paymentService = getIt<PaymentService>();
final paymentResponseFuture = paymentService
.processQuickPayWithinBank(transfer);
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: paymentResponseFuture),
),
);
},
),
),
);
}
},
),
),
],
), ),
), ),
), IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
), ),
); );
} }

View File

@@ -11,26 +11,43 @@ class SecurityErrorScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: Padding( body: Stack(
padding: const EdgeInsets.all(20.0), children: [
child: Column( Padding(
mainAxisAlignment: MainAxisAlignment.center, padding: const EdgeInsets.all(20.0),
children: [ child: Column(
Lottie.asset('assets/animations/error.json', height: 200), mainAxisAlignment: MainAxisAlignment.center,
const SizedBox(height: 20), children: [
Text( Lottie.asset('assets/animations/error.json', height: 200),
message, const SizedBox(height: 20),
textAlign: TextAlign.center, Text(
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600), message,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.w600),
),
const SizedBox(height: 40),
ElevatedButton(
onPressed: () => SystemChannels.platform
.invokeMethod('SystemNavigator.pop'),
child: const Text('Okay'),
),
],
), ),
const SizedBox(height: 40), ),
ElevatedButton( IgnorePointer(
onPressed: () => child: Center(
SystemChannels.platform.invokeMethod('SystemNavigator.pop'), child: Opacity(
child: const Text('Okay'), opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
), ),
], ),
), ],
), ),
); );
} }

View File

@@ -0,0 +1,175 @@
// ignore_for_file: unused_element
import 'package:flutter/material.dart';
import '../../../l10n/app_localizations.dart';
// Enum to define the type of location
class Location {
final String name;
final String address;
Location({
required this.name,
required this.address,
});
}
class ATMLocatorScreen extends StatefulWidget {
const ATMLocatorScreen({super.key});
@override
State<ATMLocatorScreen> createState() => _ATMLocatorScreenState();
}
class _ATMLocatorScreenState extends State<ATMLocatorScreen> {
final TextEditingController _searchController = TextEditingController();
final List<Location> _allLocations = [
Location(
name: "Dharamsala ATM",
address: "Near Main Square, Dharamsala",
),
Location(
name: "Kangra ATM",
address: "Opposite Bus Stand, Kangra",
),
];
List<Location> _filteredLocations = [];
bool _isLoading = false;
@override
void initState() {
super.initState();
// _fetchAndSetLocations();
_filteredLocations = _allLocations;
}
// Example of a future API fetching function
/*
Future<void> _fetchAndSetLocations() async {
setState(() {
_isLoading = true;
});
try {
// final locations = await yourApiService.getLocations();
// setState(() {
// _allLocations = locations;
// _filteredLocations = locations;
// });
} catch (e) {
// Handle error
} finally {
setState(() {
_isLoading = false;
});
}
}
*/
void _filterLocations(String query) {
setState(() {
if (query.isEmpty) {
_filteredLocations = _allLocations;
} else {
_filteredLocations = _allLocations.where((location) {
final lowerQuery = query.toLowerCase();
return location.name.toLowerCase().contains(lowerQuery) ||
location.address.toLowerCase().contains(lowerQuery);
}).toList();
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("ATM Locator"),
),
body: Stack(
children: [
Column(
children: [
Padding(
padding: const EdgeInsets.all(12.0),
child: TextField(
controller: _searchController,
onChanged: _filterLocations,
decoration: InputDecoration(
hintText: "Name/Address",
prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
),
// Content area
Expanded(
child: _isLoading
? const Center(child: CircularProgressIndicator())
: _filteredLocations.isEmpty
? const Center(
child: Text("No matching locations found"))
: ListView.builder(
itemCount: _filteredLocations.length,
itemBuilder: (context, index) {
final location = _filteredLocations[index];
return _buildLocationItem(location);
},
),
),
],
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
),
);
}
Widget _buildHeader(String title) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Text(
title,
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.primary,
),
),
);
}
// Helper widget to build a single location item
Widget _buildLocationItem(Location location) {
return Card(
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: ListTile(
leading: const Icon(Icons.currency_rupee),
title: Text(location.name,
style: const TextStyle(fontWeight: FontWeight.bold)),
subtitle: Text(
"Address: ${location.address}",
),
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Selected ${location.name}")),
);
},
),
);
}
}

View File

@@ -3,22 +3,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
// Enum to define the type of location
enum LocationType { branch, atm }
class Location { class Location {
final String name; final String name;
final String? code; // Nullable for ATMs final String? code; // Nullable for ATMs
final String? ifsc; // Nullable for ATMs final String? ifsc; // Nullable for ATMs
final String address; final String address;
final LocationType type;
Location({ Location({
required this.name, required this.name,
this.code, this.code,
this.ifsc, this.ifsc,
required this.address, required this.address,
required this.type,
}); });
} }
@@ -38,24 +33,12 @@ class _BranchLocatorScreenState extends State<BranchLocatorScreen> {
code: "002", code: "002",
ifsc: "KACE0000002", ifsc: "KACE0000002",
address: "Civil Lines Dharmashala, Kangra, HP - 176215", address: "Civil Lines Dharmashala, Kangra, HP - 176215",
type: LocationType.branch,
), ),
Location( Location(
name: "Kangra", name: "Kangra",
code: "033", code: "033",
ifsc: "KACE0000033", ifsc: "KACE0000033",
address: "Rajput Bhawankangrapo, Kangra, HP ", address: "Rajput Bhawankangrapo, Kangra, HP ",
type: LocationType.branch,
),
Location(
name: "Dharamsala ATM",
address: "Near Main Square, Dharamsala",
type: LocationType.atm,
),
Location(
name: "Kangra ATM",
address: "Opposite Bus Stand, Kangra",
type: LocationType.atm,
), ),
]; ];
@@ -112,37 +95,54 @@ Future<void> _fetchAndSetLocations() async {
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context).branchLocator), title: Text(AppLocalizations.of(context).branchLocator),
), ),
body: Column( body: Stack(
children: [ children: [
Padding( Column(
padding: const EdgeInsets.all(12.0), children: [
child: TextField( Padding(
controller: _searchController, padding: const EdgeInsets.all(12.0),
onChanged: _filterLocations, child: TextField(
decoration: InputDecoration( controller: _searchController,
hintText: AppLocalizations.of(context).searchbranchby, onChanged: _filterLocations,
prefixIcon: const Icon(Icons.search), decoration: InputDecoration(
border: OutlineInputBorder( hintText: AppLocalizations.of(context).searchbranchby,
borderRadius: BorderRadius.circular(12), prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
),
// Content area
Expanded(
child: _isLoading
? const Center(child: CircularProgressIndicator())
: _filteredLocations.isEmpty
? const Center(
child: Text("No matching locations found"))
: ListView.builder(
itemCount: _filteredLocations.length,
itemBuilder: (context, index) {
final location = _filteredLocations[index];
return _buildLocationItem(location);
},
),
),
],
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
), ),
), ),
), ),
), ),
// Content area
Expanded(
child: _isLoading
? const Center(child: CircularProgressIndicator())
: _filteredLocations.isEmpty
? const Center(child: Text("No matching locations found"))
: ListView.builder(
itemCount: _filteredLocations.length,
itemBuilder: (context, index) {
final location = _filteredLocations[index];
return _buildLocationItem(location);
},
),
),
], ],
), ),
); );
@@ -163,20 +163,16 @@ Future<void> _fetchAndSetLocations() async {
// Helper widget to build a single location item // Helper widget to build a single location item
Widget _buildLocationItem(Location location) { Widget _buildLocationItem(Location location) {
final isBranch = location.type == LocationType.branch;
return Card( return Card(
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: ListTile( child: ListTile(
leading: CircleAvatar( leading: const CircleAvatar(
child: Icon(isBranch ? Icons.location_city : Icons.currency_rupee), child: Icon(Icons.location_city),
), ),
title: Text(location.name, title: Text(location.name,
style: const TextStyle(fontWeight: FontWeight.bold)), style: const TextStyle(fontWeight: FontWeight.bold)),
subtitle: Text( subtitle: Text(
isBranch "Code: ${location.code} | IFSC: ${location.ifsc}\nAddress: ${location.address}"),
? "Code: ${location.code} | IFSC: ${location.ifsc}\nAddress: ${location.address}"
: "Address: ${location.address}",
),
onTap: () { onTap: () {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Selected ${location.name}")), SnackBar(content: Text("Selected ${location.name}")),

View File

@@ -42,6 +42,22 @@ class _FaqsScreenState extends State<FaqsScreen> {
], ],
), ),
), ),
body: Stack(
children: [
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
),
); );
} }
} }

View File

@@ -29,6 +29,22 @@ class _QuickLinksScreenState extends State<QuickLinksScreen> {
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context).quickLinks), title: Text(AppLocalizations.of(context).quickLinks),
), ),
body: Stack(
children: [
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.1, // Low opacity
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
],
),
); );
} }
} }

View File

@@ -1,3 +1,4 @@
import 'package:kmobile/features/service/screens/atm_locator_screen.dart';
import 'package:kmobile/features/service/screens/branch_locator_screen.dart'; import 'package:kmobile/features/service/screens/branch_locator_screen.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
@@ -24,57 +25,73 @@ class _ServiceScreen extends State<ServiceScreen> {
), ),
centerTitle: false, centerTitle: false,
), ),
body: ListView( body: Stack(
children: [ children: [
ServiceManagementTile( ListView(
icon: Symbols.add, children: [
label: AppLocalizations.of(context).accountOpeningDeposit, // ServiceManagementTile(
onTap: () {}, // icon: Symbols.add,
disabled: true, // label: AppLocalizations.of(context).accountOpeningDeposit,
// onTap: () {},
// disabled: true,
// ),
// const Divider(height: 1),
// ServiceManagementTile(
// icon: Symbols.add,
// label: AppLocalizations.of(context).accountOpeningLoan,
// onTap: () {},
// disabled: true,
// ),
// const Divider(height: 1),
ServiceManagementTile(
icon: Symbols.captive_portal,
label: AppLocalizations.of(context).quickLinks,
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const QuickLinksScreen()),
);
},
disabled: false,
),
const Divider(height: 1),
ServiceManagementTile(
icon: Symbols.question_mark,
label: AppLocalizations.of(context).faq,
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const FaqsScreen()),
);
},
disabled: false,
),
const Divider(height: 1),
ServiceManagementTile(
icon: Symbols.location_pin,
label: "ATM Locator",
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ATMLocatorScreen()));
},
disabled: false,
),
const Divider(height: 1),
],
), ),
const Divider(height: 1), IgnorePointer(
ServiceManagementTile( child: Center(
icon: Symbols.add, child: Opacity(
label: AppLocalizations.of(context).accountOpeningLoan, opacity: 0.1, // Low opacity
onTap: () {}, child: Image.asset(
disabled: true, 'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
), ),
const Divider(height: 1),
ServiceManagementTile(
icon: Symbols.captive_portal,
label: AppLocalizations.of(context).quickLinks,
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const QuickLinksScreen()),
);
},
disabled: true,
),
const Divider(height: 1),
ServiceManagementTile(
icon: Symbols.question_mark,
label: AppLocalizations.of(context).faq,
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const FaqsScreen()),
);
},
disabled: true,
),
const Divider(height: 1),
ServiceManagementTile(
icon: Symbols.location_pin,
label: AppLocalizations.of(context).branchLocator,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const BranchLocatorScreen()));
},
disabled: true,
),
const Divider(height: 1),
], ],
), ),
); );

View File

@@ -15,13 +15,13 @@ void main() async {
]); ]);
// Check for device compromise // Check for device compromise
final compromisedMessage = await SecurityService.deviceCompromisedMessage; // final compromisedMessage = await SecurityService.deviceCompromisedMessage;
if (compromisedMessage != null) { // if (compromisedMessage != null) {
runApp(MaterialApp( // runApp(MaterialApp(
home: SecurityErrorScreen(message: compromisedMessage), // home: SecurityErrorScreen(message: compromisedMessage),
)); // ));
return; // return;
} // }
await setupDependencies(); await setupDependencies();
runApp(const KMobile()); runApp(const KMobile());
} }