41 Commits

Author SHA1 Message Date
f9fd74ea53 Rooted Device Check #1.2 2025-09-02 17:24:43 +05:30
852f708633 Rooted Device Check #1 2025-09-02 17:21:58 +05:30
de596aa138 Code Obfuscation #1 2025-09-02 16:05:50 +05:30
720c6ec03a View Cards static page 2025-09-02 15:48:23 +05:30
d081a5433c Localization Changes #5 2025-09-01 16:41:32 +05:30
90f4a6bb81 Removed bugs and duplicates 2025-09-01 12:32:17 +05:30
asif
f71c8d646b removed a bunch of print statements and added a few async checks 2025-08-31 21:44:56 +05:30
asif
6a8f091ac5 changed welcome_screen to splash_screen in app.dart 2025-08-31 21:44:56 +05:30
asif
596f0a96eb replaced print with log in theme_cubit.dart 2025-08-31 21:44:04 +05:30
asif
768d312066 refactored welcome string to splash screen 2025-08-31 21:44:04 +05:30
asif
4277ca9169 replaced print with log in neft_service.dart 2025-08-31 21:44:04 +05:30
asif
53caa5b7ae removed decorations from title bar and chaged constant colors to themes 2025-08-31 21:44:04 +05:30
asif
bfa0721e79 removed unnecessary bg color from avatar 2025-08-31 21:44:04 +05:30
asif
75bcce8201 removed unnecessary decorations from title bar 2025-08-31 21:44:04 +05:30
asif
99f4b1b735 UI changes in customer info screen
Removed unnecessary decorations from title bar.
2025-08-31 21:44:04 +05:30
asif
6ebc96d153 removed some unnecessary code and add some async guards 2025-08-31 21:44:04 +05:30
asif
6496aa95c0 changed greeting font and size 2025-08-31 21:44:04 +05:30
asif
e91efafa0e increased font weight of title bar 2025-08-31 21:44:04 +05:30
asif
61a6e356d9 increased font weight in dashboard card 2025-08-31 21:44:04 +05:30
asif
a48781ad1b changed some wordings in the card 2025-08-31 21:44:04 +05:30
asif
d425af184e updated android ndk version 2025-08-31 21:44:04 +05:30
asif
bc2c460f96 changed the font size of acc no in card 2025-08-31 21:44:04 +05:30
asif
ef3556f207 removed some print statements 2025-08-31 21:44:04 +05:30
asif
6724d8bed0 refactored the balacnce card to remove unnecessary things 2025-08-31 21:44:04 +05:30
asif
83ed973b44 fixed some async gaps warnings 2025-08-31 21:44:04 +05:30
asif
f7dd31fb93 added rubik text theme 2025-08-31 21:44:04 +05:30
asif
9c60dc1c1c changed debit and credit icons colors 2025-08-31 21:44:04 +05:30
asif
c369ad415d added weight and dim color to the dashboard QL icons 2025-08-31 21:44:04 +05:30
asif
f934f0bff6 fixed some warnings and colors in the dashboard screen 2025-08-31 21:44:04 +05:30
asif
da0287ef38 fixed some print, async context warnings in
fund_transfer_amount_screen.dart
2025-08-31 21:44:04 +05:30
asif
f65507a706 fixed a context used across async gap warning and removed comments 2025-08-31 21:41:09 +05:30
9f6b35d3eb Beneficiary Details alignment fixed 2025-08-29 15:08:14 +05:30
a33b4bc1e1 Localization changes #4 2025-08-28 13:28:21 +05:30
0d629226a8 Available Balance in Account Statement #2 2025-08-27 18:21:42 +05:30
6d502a0c81 Available Balance in Account Statement 2025-08-27 17:17:47 +05:30
96d1e37c42 Beneficiary Validation Changes #2 2025-08-27 16:13:49 +05:30
b0610ad84d Beneficiary Validation Changes 2025-08-27 16:08:47 +05:30
ceb29ee7fe Manage Beneficiary delete Confirm 2025-08-27 15:00:46 +05:30
57cb93c124 Fund Transfer page with Own Bank and Outside Bank modified 2025-08-27 14:39:51 +05:30
0ac9a1f319 Merge branch 'uat-2' of https://7o9o-lb-526275444.ap-south-1.elb.amazonaws.com/md.asif5/kmobile into uat-2 2025-08-27 13:18:30 +05:30
d3ad68b25c Fund Transfer page with Own Bank and Outside Bank modified 2025-08-27 13:16:26 +05:30
32 changed files with 1176 additions and 738 deletions

View File

@@ -25,7 +25,7 @@ if (flutterVersionName == null) {
android {
namespace "com.example.kmobile"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
ndkVersion "27.0.12077973"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
@@ -53,9 +53,13 @@ android {
buildTypes {
release {
signingConfig signingConfigs.debug
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules.pro'
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

77
android/app/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,77 @@
# Keep Flutter embedding and plugin registrant (important)
-keep class io.flutter.embedding.** { *; }
-keep class io.flutter.plugins.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.app.** { *; }
# Keep Application / Activity if you customized them (replace with your package name)
# -keep class com.yourcompany.yourapp.MainActivity { *; }
# -keep class com.yourcompany.yourapp.** { *; }
# Keep classes referenced from AndroidManifest via reflection or lifecycle
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
public <init>(android.content.Context, ...);
}
# Keep native entry points (JNI) if any (example)
-keepclasseswithmembernames class * {
native <methods>;
}
# Keep classes that use reflection heavily (OKHttp/Retrofit/Gson)
# Retrofit/OkHttp
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-keep class retrofit2.** { *; }
-keep interface retrofit2.** { *; }
# Gson (models accessed by reflection)
-keep class com.google.gson.** { *; }
-keepattributes Signature
-keepattributes *Annotation*
# Keep Firebase (if you use it)
-keep class com.google.firebase.** { *; }
-keep class com.google.android.gms.** { *; }
# WorkManager (if used)
-keep class androidx.work.impl.background.systemjob.SystemJobService { *; }
-keep class androidx.work.** { *; }
# Room/DB entities - if you use Room, keep annotations and entity classes
-keepclassmembers class * {
@androidx.room.* <fields>;
}
-keep class androidx.room.** { *; }
# Keep classes loaded by reflection (e.g. through Class.forName)
-keepclassmembers,includedescriptorclasses class * {
public static <fields>;
public <init>(...);
}
# Keep Kotlin metadata (for Kotlin reflection)
-keep class kotlin.Metadata { *; }
# Keep names of classes annotated with @Keep
-keep @androidx.annotation.Keep class * { *; }
-keepclassmembers class * {
@androidx.annotation.Keep *;
}
# If using Gson TypeAdapterFactory via reflection
-keepclassmembers class * {
static ** typeAdapterFactory*(...);
}
# Don't remove debug/logging if you want (optional)
#-keep class android.util.Log { *; }
# Keep any generated plugin registrant classes if present (older projects)
-keep class io.flutter.plugins.GeneratedPluginRegistrant { *; }
# (Optional) Keep parcelable implementations if those are serialized dynamically
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

View File

@@ -1,5 +1,4 @@
import 'dart:developer';
import 'package:dio/dio.dart';
import 'package:kmobile/data/models/ifsc.dart';
import 'package:kmobile/data/models/beneficiary.dart';
@@ -105,4 +104,18 @@ class BeneficiaryService {
return [];
}
}
Future<void> deleteBeneficiary(String accountNo) async {
try {
final response = await _dio.delete('/api/beneficiary/$accountNo');
if (response.statusCode != 204) {
throw Exception('Failed to delete beneficiary');
}
} on DioException catch (e) {
throw Exception('Network error: ${e.message}');
} catch (e) {
throw Exception('Unexpected error: ${e.toString()}');
}
}
}

View File

@@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:dio/dio.dart';
import 'package:kmobile/data/models/neft_response.dart';
import 'package:kmobile/data/models/neft_transaction.dart';
@@ -23,7 +25,7 @@ class NeftService {
'NEFT transaction failed with status code: ${response.statusCode}');
}
} on DioException {
print('DioException Occured');
log('DioException Occured');
rethrow;
} catch (e) {
throw Exception('An unexpected error occurred: ${e.toString()}');

View File

@@ -11,7 +11,7 @@ import 'config/routes.dart';
import 'di/injection.dart';
import 'features/auth/controllers/auth_cubit.dart';
import 'features/card/screens/card_management_screen.dart';
import 'features/auth/screens/welcome_screen.dart';
import 'features/auth/screens/splash_screen.dart';
import 'features/auth/screens/login_screen.dart';
import 'features/service/screens/service_screen.dart';
import 'features/dashboard/screens/dashboard_screen.dart';
@@ -40,7 +40,7 @@ class _KMobileState extends State<KMobile> {
void initState() {
super.initState();
loadPreferences();
Future.delayed(const Duration(seconds: 2), () {
Future.delayed(const Duration(seconds: 3), () {
setState(() {
showSplash = false;
});
@@ -67,7 +67,6 @@ class _KMobileState extends State<KMobile> {
@override
Widget build(BuildContext context) {
// Set status bar color and brightness
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
@@ -119,7 +118,6 @@ class AuthGate extends StatefulWidget {
class _AuthGateState extends State<AuthGate> {
bool _checking = true;
bool _isLoggedIn = false;
bool _showWelcome = true;
bool _hasMPin = false;
bool _biometricEnabled = false;
bool _biometricTried = false;
@@ -175,18 +173,7 @@ class _AuthGateState extends State<AuthGate> {
if (_checking) {
return const SplashScreen();
}
// ✅ Step 1: Show welcome screen first, only once
if (_showWelcome) {
return WelcomeScreen(
onContinue: () {
setState(() {
_showWelcome = false;
});
},
);
}
// ✅ Step 2: Check login status
if (_isLoggedIn) {
if (_hasMPin) {
if (_biometricEnabled) {
@@ -201,7 +188,6 @@ class _AuthGateState extends State<AuthGate> {
return const NavigationScaffold(); // Authenticated
}
// ❌ Biometric failed → Show MPIN screen
return MPinScreen(
mode: MPinMode.enter,
onCompleted: (_) {
@@ -227,7 +213,6 @@ class _AuthGateState extends State<AuthGate> {
);
}
} else {
// No MPIN set → show MPIN set screen + biometric dialog
return MPinScreen(
mode: MPinMode.set,
onCompleted: (_) async {
@@ -289,8 +274,6 @@ class _AuthGateState extends State<AuthGate> {
);
}
}
// ✅ Step 3: If not logged in, show login screen
return const LoginScreen();
}
}
@@ -382,29 +365,6 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
}
}
class SplashScreen extends StatelessWidget {
const SplashScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const CircularProgressIndicator(),
const SizedBox(height: 20),
Text(
AppLocalizations.of(context).loading,
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
);
}
}
// Add this widget at the end of the file
class BiometricPromptScreen extends StatelessWidget {
final VoidCallback onCompleted;
@@ -466,6 +426,9 @@ class BiometricPromptScreen extends StatelessWidget {
],
),
);
if (!context.mounted) {
return;
}
if (result == true) {
await _handleBiometric(context);
} else {

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:kmobile/features/auth/screens/mpin_screen.dart';
import 'package:kmobile/features/auth/screens/splash_screen.dart';
import '../app.dart';
import '../features/auth/screens/login_screen.dart';
// import '../features/auth/screens/forgot_password_screen.dart';

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'theme_type.dart';
import 'package:google_fonts/google_fonts.dart';
class AppThemes {
static ThemeData getLightTheme(ThemeType type) {
@@ -24,11 +25,11 @@ class AppThemes {
brightness: Brightness.light, // Explicitly set for a light theme
);
// Create the ThemeData from the ColorScheme
return ThemeData.from(
colorScheme: colorScheme,
useMaterial3: true, // Recommended for modern Flutter apps
).copyWith(
colorScheme: colorScheme,
useMaterial3: true, // Recommended for modern Flutter apps
textTheme: GoogleFonts.rubikTextTheme())
.copyWith(
scaffoldBackgroundColor: Colors.white,
bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: colorScheme.surface,

View File

@@ -1,5 +1,3 @@
// ignore_for_file: non_constant_identifier_names
class Beneficiary {
final String accountNo;
final String accountType;
@@ -53,7 +51,6 @@ class Beneficiary {
final beneficiaryList = jsonList
.map((beneficiary) => Beneficiary.fromJson(beneficiary))
.toList();
print(beneficiaryList);
return beneficiaryList;
}

View File

@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/data/models/user.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart';
class AccountInfoScreen extends StatefulWidget {
@@ -32,35 +30,9 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
int selectedIndex = widget.selectedIndex;
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Symbols.arrow_back_ios_new),
onPressed: () {
Navigator.pop(context);
},
),
title: Text(
AppLocalizations.of(context).accountInfo,
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
centerTitle: false,
actions: [
Padding(
padding: const EdgeInsets.only(right: 10.0),
child: CircleAvatar(
backgroundColor: Colors.grey[200],
radius: 20,
child: SvgPicture.asset(
'assets/images/avatar_male.svg',
width: 40,
height: 40,
fit: BoxFit.cover,
),
),
),
],
),
body: ListView(
padding: const EdgeInsets.all(16.0),
@@ -70,7 +42,6 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 14),
),
/// Dropdown to change account
DropdownButton<User>(
value: selectedUser,
onChanged: (User? newUser) {
@@ -130,6 +101,7 @@ class InfoRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Container(
width: double.infinity,
margin: const EdgeInsets.symmetric(vertical: 8),
@@ -138,16 +110,16 @@ class InfoRow extends StatelessWidget {
children: [
Text(
title,
style: const TextStyle(
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w500,
color: Colors.black87,
color: theme.colorScheme.onSurfaceVariant,
),
),
const SizedBox(height: 3),
Text(
value,
style: const TextStyle(fontSize: 16, color: Colors.black),
style: TextStyle(fontSize: 16, color: theme.colorScheme.onSurface),
),
],
),

View File

@@ -10,7 +10,12 @@ import 'transaction_details_screen.dart';
class AccountStatementScreen extends StatefulWidget {
final String accountNo;
const AccountStatementScreen({super.key, required this.accountNo});
final String balance;
const AccountStatementScreen({
super.key,
required this.accountNo,
required this.balance,
});
@override
State<AccountStatementScreen> createState() => _AccountStatementScreen();
@@ -150,7 +155,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
Text(
"${AppLocalizations.of(context).accountNumber}: ",
style: const TextStyle(
fontSize: 19,
fontSize: 17,
fontWeight: FontWeight.bold,
),
),
@@ -158,12 +163,19 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
],
),
const SizedBox(height: 15),
// Text(
// AppLocalizations.of(context).availableBalance,
// style: const TextStyle(fontSize: 17),
// ),
// const SizedBox(height: 15),
// Text(widget.accountNo, style: const TextStyle(fontSize: 17)),
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),
@@ -202,7 +214,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
padding: const EdgeInsets.symmetric(vertical: 16),
),
child: Text(
"Search",
AppLocalizations.of(context).search,
style: TextStyle(
color: Theme.of(context).scaffoldBackgroundColor,
fontSize: 16,

View File

@@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:kmobile/config/theme_type.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -17,7 +19,7 @@ class ThemeCubit extends Cubit<ThemeState> {
}
Future<void> changeTheme(ThemeType type) async {
print("Attempting to change theme to: ${type.toString()}");
log("Attempting to change theme...");
final prefs = await SharedPreferences.getInstance();
await prefs.setInt('theme_type', type.index);
emit(ThemeState(themeType: type));

View File

@@ -1,70 +1,51 @@
import '../../../l10n/app_localizations.dart';
import 'package:flutter/material.dart';
import 'dart:async';
class WelcomeScreen extends StatefulWidget {
final VoidCallback onContinue;
const WelcomeScreen({super.key, required this.onContinue});
class SplashScreen extends StatefulWidget {
const SplashScreen({super.key});
@override
State<WelcomeScreen> createState() => _WelcomeScreenState();
State<SplashScreen> createState() => _SplashScreenState();
}
class _WelcomeScreenState extends State<WelcomeScreen> {
@override
void initState() {
super.initState();
// Automatically go to logizn after 4 seconds
Timer(const Duration(seconds: 4), () {
widget.onContinue();
});
}
class _SplashScreenState extends State<SplashScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
/// 🔹 Background Image
Positioned.fill(
child: Image.asset(
'assets/images/kconnect2.webp',
fit: BoxFit.cover,
),
),
/// 🔹 Centered Text Overlay
Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
AppLocalizations.of(context).kconnect,
style: TextStyle(
style: const TextStyle(
fontSize: 36,
fontWeight: FontWeight.bold,
color: Theme.of(context).dialogBackgroundColor,
letterSpacing: 1.5,
color: Color(0xFFFFFFFF),
),
),
const SizedBox(height: 12),
Text(
AppLocalizations.of(context).kccBankFull,
textAlign: TextAlign.center,
style: TextStyle(
style: const TextStyle(
fontSize: 18,
color: Theme.of(context).dialogBackgroundColor,
color: Color(0xFFFFFFFF),
letterSpacing: 1.2,
),
),
],
),
),
/// 🔹 Loading Spinner at Bottom
Positioned(
bottom: 40,
left: 0,

View File

@@ -46,7 +46,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
accountType = AppLocalizations.of(context).savings;
accountType = 'Savings';
});
});
}
@@ -87,11 +87,17 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
final service = getIt<BeneficiaryService>();
try {
final String beneficiaryName = await service.validateBeneficiary(
accountNo: accountNo,
ifscCode: ifsc,
remitterName: remitter,
);
String beneficiaryName;
if (ifsc.toLowerCase().contains('kace')) {
beneficiaryName =
await service.validateBeneficiaryWithinBank(accountNo);
} else {
beneficiaryName = await service.validateBeneficiary(
accountNo: accountNo,
ifscCode: ifsc,
remitterName: remitter,
);
}
setState(() {
nameController.text = beneficiaryName;
@@ -121,8 +127,9 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
// Ensure beneficiary is validated before proceeding to TPIN
if (!_isBeneficiaryValidated) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Please validate beneficiary details first.')),
SnackBar(
content: Text(AppLocalizations.of(context)
.pleaseValidateBeneficiaryDetailsFirst)),
);
return;
}
@@ -509,8 +516,8 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
),
),
items: [
AppLocalizations.of(context).savings,
AppLocalizations.of(context).current,
'Savings',
'Current',
]
.map(
(type) => DropdownMenuItem(

View File

@@ -0,0 +1,161 @@
import 'package:flutter/material.dart';
import 'package:kmobile/data/models/beneficiary.dart';
import 'package:kmobile/di/injection.dart';
import 'package:kmobile/widgets/bank_logos.dart';
import 'package:kmobile/api/services/beneficiary_service.dart';
import '../../../l10n/app_localizations.dart';
class BeneficiaryDetailsScreen extends StatelessWidget {
final Beneficiary beneficiary;
BeneficiaryDetailsScreen({super.key, required this.beneficiary});
final service = getIt<BeneficiaryService>();
void _deleteBeneficiary(BuildContext context) async {
try {
await service.deleteBeneficiary(beneficiary.accountNo);
if (!context.mounted) {
return;
}
_showSuccessDialog(context);
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Failed to delete beneficiary: $e')),
);
}
}
void _showSuccessDialog(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Success'),
content: const Text('Beneficiary deleted successfully.'),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).popUntil((route) => route.isFirst);
},
),
],
);
},
);
}
void _showDeleteConfirmationDialog(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Delete Beneficiary'),
content:
const Text('Are you sure you want to delete this beneficiary?'),
actions: <Widget>[
TextButton(
child: const Text('Cancel'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('Delete'),
onPressed: () {
//Navigator.of(context).pop();
_deleteBeneficiary(context);
},
),
],
);
},
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context).beneficiarydetails),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
CircleAvatar(
radius: 24,
backgroundColor: Colors.transparent,
child: getBankLogo(beneficiary.bankName),
),
const SizedBox(width: 16),
Text(
beneficiary.name,
style: const TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
),
],
),
const SizedBox(height: 24),
_buildDetailRow('${AppLocalizations.of(context).bankName} ',
beneficiary.bankName ?? 'N/A'),
_buildDetailRow('${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),
),
],
),
],
),
),
);
}
Widget _buildDetailRow(String label, String value) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label, style: const TextStyle(fontWeight: FontWeight.bold)),
const SizedBox(width: 16),
Flexible(
child: Text(
value,
textAlign: TextAlign.end,
),
),
],
),
);
}
}

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:kmobile/data/models/beneficiary.dart';
import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
import 'package:kmobile/features/beneficiaries/screens/beneficiary_details_screen.dart';
import '../../../l10n/app_localizations.dart';
import '../../../di/injection.dart';
import 'package:kmobile/api/services/beneficiary_service.dart';
@@ -88,6 +89,14 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => BeneficiaryDetailsScreen(beneficiary: item),
),
);
},
);
},
);

View File

@@ -0,0 +1,164 @@
import 'package:flutter/material.dart';
class CardDetailsScreen extends StatelessWidget {
const CardDetailsScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("My Cards"),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: ListView(
children: const [
CardTile(
cardNumber: "**** **** **** 1234",
cardNetwork: "VISA",
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",
),
],
),
),
);
}
}
class CardTile extends StatelessWidget {
final String cardNumber;
final String cardNetwork;
final String cardType;
final String validFrom;
final String validTo;
const CardTile({
super.key,
required this.cardNumber,
required this.cardNetwork,
required this.cardType,
required this.validFrom,
required this.validTo,
});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
gradient: const LinearGradient(
colors: [Colors.blue, Colors.indigo],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
boxShadow: const [
BoxShadow(
color: Colors.black26,
blurRadius: 8,
spreadRadius: 2,
offset: Offset(2, 4),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Top row: Logo + Bank name
Row(
children: [
Image.asset(
'assets/images/logo.png',
width: 40,
height: 40,
),
const SizedBox(width: 8),
const Text(
"Kangra Central Co-operative Bank",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
],
),
const SizedBox(height: 24),
// Card number (masked)
Text(
cardNumber,
style: const TextStyle(
color: Colors.white,
fontSize: 22,
letterSpacing: 3,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 16),
// Validity
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("VALID FROM",
style: TextStyle(color: Colors.white70, fontSize: 10)),
Text(
validFrom,
style: const TextStyle(color: Colors.white, fontSize: 14),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("VALID UPTO",
style: TextStyle(color: Colors.white70, fontSize: 10)),
Text(
validTo,
style: const TextStyle(color: Colors.white, fontSize: 14),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
cardNetwork,
style: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
Text(
cardType,
style: const TextStyle(
color: Colors.white70,
fontSize: 12,
),
),
],
),
],
),
],
),
);
}
}

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/features/card/screens/block_card_screen.dart';
import 'package:kmobile/features/card/screens/card_details_screen.dart';
import 'package:kmobile/features/card/screens/card_pin_change_details_screen.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart';
@@ -64,11 +65,24 @@ class _CardManagementScreen extends State<CardManagementScreen> {
CardManagementTile(
icon: Symbols.password_2,
label: AppLocalizations.of(context).changeCardPin,
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const CardPinChangeDetailsScreen(),
// ),
// );
},
),
const Divider(height: 1),
CardManagementTile(
icon: Symbols.payment_card,
label: AppLocalizations.of(context).viewCardDeatils,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CardPinChangeDetailsScreen(),
builder: (context) => const CardDetailsScreen(),
),
);
},
@@ -80,6 +94,7 @@ class _CardManagementScreen extends State<CardManagementScreen> {
}
}
class CardManagementTile extends StatelessWidget {
final IconData icon;
final String label;

View File

@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/data/models/user.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart';
class CustomerInfoScreen extends StatefulWidget {
@@ -16,34 +15,12 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
late final User user = widget.user;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Symbols.arrow_back_ios_new),
onPressed: () {
Navigator.pop(context);
},
),
title: Text(
AppLocalizations.of(context).kMobile,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
AppLocalizations.of(context).customerInfo,
),
actions: [
Padding(
padding: const EdgeInsets.only(right: 10.0),
child: CircleAvatar(
backgroundColor: Colors.grey[200],
radius: 20,
child: SvgPicture.asset(
'assets/images/avatar_male.svg',
width: 100,
height: 100,
fit: BoxFit.cover,
),
),
),
],
),
body: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
@@ -55,7 +32,6 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
children: [
const SizedBox(height: 30),
CircleAvatar(
backgroundColor: Colors.grey[200],
radius: 50,
child: SvgPicture.asset(
'assets/images/avatar_male.svg',
@@ -68,16 +44,18 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
padding: const EdgeInsets.only(top: 10.0),
child: Text(
user.name ?? '',
style: const TextStyle(
style: TextStyle(
fontSize: 20,
color: Colors.black,
color: theme.colorScheme.onSurface,
fontWeight: FontWeight.w500,
),
),
),
Text(
'${AppLocalizations.of(context).cif}: ${user.cifNumber ?? 'N/A'}',
style: const TextStyle(fontSize: 16, color: Colors.grey),
style: TextStyle(
fontSize: 16,
color: theme.colorScheme.onSurfaceVariant),
),
const SizedBox(height: 30),
InfoField(
@@ -125,6 +103,7 @@ class InfoField extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Container(
width: double.infinity,
margin: const EdgeInsets.symmetric(vertical: 8),
@@ -133,16 +112,16 @@ class InfoField extends StatelessWidget {
children: [
Text(
label,
style: const TextStyle(
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w500,
color: Colors.black87,
color: theme.colorScheme.onSurfaceVariant,
),
),
const SizedBox(height: 3),
Text(
value,
style: const TextStyle(fontSize: 16, color: Colors.black),
style: TextStyle(fontSize: 16, color: theme.colorScheme.onSurface),
),
],
),

View File

@@ -1,4 +1,3 @@
// ignore_for_file: use_build_context_synchronously
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -13,7 +12,7 @@ import 'package:kmobile/features/auth/controllers/auth_state.dart';
import 'package:kmobile/features/customer_info/screens/customer_info_screen.dart';
import 'package:kmobile/features/beneficiaries/screens/manage_beneficiaries_screen.dart';
import 'package:kmobile/features/enquiry/screens/enquiry_screen.dart';
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_beneficiary_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/quick_pay/screens/quick_pay_screen.dart';
import 'package:kmobile/security/secure_storage.dart';
@@ -82,8 +81,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
// Call your AuthCubit or repository to refresh user/accounts data
await context.read<AuthCubit>().refreshUserData();
} catch (e) {
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
/*const*/ SnackBar(
SnackBar(
content: Text(AppLocalizations.of(context).failedToRefresh),
),
);
@@ -94,13 +96,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
Widget _buildBalanceShimmer() {
final theme = Theme.of(context);
return Shimmer.fromColors(
baseColor: Theme.of(context).dialogBackgroundColor,
highlightColor: Theme.of(context).dialogBackgroundColor,
baseColor: theme.primaryColor,
highlightColor: theme.colorScheme.onPrimary,
child: Container(
width: 100,
height: 32,
color: Theme.of(context).scaffoldBackgroundColor),
width: 200, height: 42, color: theme.scaffoldBackgroundColor),
);
}
@@ -169,6 +170,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
onPressed: () async {
final auth = LocalAuthentication();
final canCheck = await auth.canCheckBiometrics;
if (!mounted) return;
bool ok = false;
if (canCheck) {
ok = await auth.authenticate(
@@ -179,6 +181,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
await storage.write('biometric_enabled', 'true');
}
await storage.write('biometric_prompt_shown', 'true');
if (!mounted) return;
Navigator.of(context).pop();
},
child: Text(AppLocalizations.of(context).enable),
@@ -190,6 +193,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return BlocListener<AuthCubit, AuthState>(
listener: (context, state) async {
if (state is Authenticated && !_biometricPromptShown) {
@@ -202,15 +206,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
},
child: Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
backgroundColor: theme.scaffoldBackgroundColor,
appBar: AppBar(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
backgroundColor: theme.scaffoldBackgroundColor,
automaticallyImplyLeading: false,
title: Text(
AppLocalizations.of(context).kconnect,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w500,
color: theme.primaryColor,
fontWeight: FontWeight.w700,
),
),
centerTitle: true,
@@ -268,10 +272,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
"${AppLocalizations.of(context).hi} $firstName",
style: GoogleFonts.montserrat().copyWith(
fontSize: 25,
color: Theme.of(context).primaryColor,
"${AppLocalizations.of(context).hi} $firstName!",
style: GoogleFonts.baumans().copyWith(
fontSize: 20,
color: theme.primaryColor,
fontWeight: FontWeight.w700,
),
),
@@ -285,7 +289,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
vertical: 10,
),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
color: theme.primaryColor,
borderRadius: BorderRadius.circular(16),
),
child: Column(
@@ -294,24 +298,22 @@ class _DashboardScreenState extends State<DashboardScreen> {
Row(
children: [
Text(
"${AppLocalizations.of(context).accountNumber}: ",
"${getFullAccountType(currAccount.accountType)}: ",
style: TextStyle(
color:
Theme.of(context).dialogBackgroundColor,
fontSize: 12,
color: theme.colorScheme.onPrimary,
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
DropdownButton<int>(
value: selectedAccountIndex,
dropdownColor: Theme.of(context).primaryColor,
dropdownColor: theme.primaryColor,
underline: const SizedBox(),
icon: const Icon(Icons.keyboard_arrow_down),
iconEnabledColor:
Theme.of(context).dialogBackgroundColor,
iconEnabledColor: theme.colorScheme.onPrimary,
style: TextStyle(
color:
Theme.of(context).dialogBackgroundColor,
fontSize: 14,
color: theme.colorScheme.onPrimary,
fontSize: 18,
),
items: List.generate(users.length, (index) {
return DropdownMenuItem<int>(
@@ -319,9 +321,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Text(
users[index].accountNo ?? 'N/A',
style: TextStyle(
color: Theme.of(context)
.dialogBackgroundColor,
fontSize: 14,
color: theme.colorScheme.onPrimary,
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
);
@@ -360,15 +362,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: 20,
height: 20,
child: CircularProgressIndicator(
color: Theme.of(context)
.dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
strokeWidth: 2,
),
)
: Icon(
Icons.refresh,
color: Theme.of(context)
.dialogBackgroundColor,
Symbols.refresh,
color: theme.colorScheme.onPrimary,
),
onPressed: isRefreshing
? null
@@ -377,22 +377,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
],
),
Text(
getFullAccountType(currAccount.accountType),
style: TextStyle(
color: Theme.of(context).dialogBackgroundColor,
fontSize: 16,
),
),
const SizedBox(height: 4),
const SizedBox(height: 15),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"",
style: TextStyle(
color:
Theme.of(context).dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
fontSize: 40,
fontWeight: FontWeight.w700,
),
@@ -403,10 +395,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
isVisible
? currAccount.currentBalance ??
'0.00'
: '********',
: '*****',
style: TextStyle(
color: Theme.of(context)
.dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
fontSize: 40,
fontWeight: FontWeight.w700,
),
@@ -432,12 +423,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
});
}
},
child: Icon(
isVisible
? Symbols.visibility_lock
: Symbols.visibility,
color: Theme.of(context)
.scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
isVisible
? Symbols.visibility_lock
: Symbols.visibility,
color: theme.scaffoldBackgroundColor,
weight: 800,
),
),
),
],
@@ -492,14 +486,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
FundTransferBeneficiaryScreen(
creditAccountNo:
users[selectedAccountIndex]
.accountNo!,
remitterName:
users[selectedAccountIndex]
.name!)));
builder: (context) => FundTransferScreen(
creditAccountNo:
users[selectedAccountIndex]
.accountNo!,
remitterName:
users[selectedAccountIndex]
.name!)));
}, disable: false),
_buildQuickLink(
Symbols.server_person,
@@ -526,6 +519,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
AccountStatementScreen(
accountNo: users[selectedAccountIndex]
.accountNo!,
balance: users[selectedAccountIndex]
.availableBalance!,
)));
}),
_buildQuickLink(Symbols.checkbook,
@@ -568,8 +563,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
tx.type == 'CR'
? Symbols.call_received
: Symbols.call_made,
color:
tx.type == 'CR' ? Colors.green : Colors.red,
color: tx.type == 'CR'
? const Color(0xFF10BB10)
: theme.colorScheme.error,
),
title: Text(
tx.date ?? '',
@@ -626,30 +622,26 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
List<Widget> _buildTransactionShimmer() {
final theme = Theme.of(context);
return List.generate(3, (i) {
return ListTile(
leading: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: CircleAvatar(
radius: 12,
backgroundColor: Theme.of(context).scaffoldBackgroundColor),
radius: 12, backgroundColor: theme.scaffoldBackgroundColor),
),
title: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: 10,
width: 100,
color: Theme.of(context).scaffoldBackgroundColor),
height: 10, width: 100, color: theme.scaffoldBackgroundColor),
),
subtitle: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: 8,
width: 60,
color: Theme.of(context).scaffoldBackgroundColor),
height: 8, width: 60, color: theme.scaffoldBackgroundColor),
),
);
});
@@ -661,6 +653,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
VoidCallback onTap, {
bool disable = false,
}) {
final theme = Theme.of(context);
return InkWell(
onTap: disable ? null : onTap,
child: Column(
@@ -669,7 +662,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
Icon(
icon,
size: 30,
color: disable ? Colors.grey : Theme.of(context).primaryColor,
color: disable
? theme.colorScheme.surfaceContainerHighest
: theme.primaryColor,
grade: 200,
weight: 700,
),
const SizedBox(height: 4),
Text(

View File

@@ -1,4 +1,3 @@
// ignore_for_file: avoid_print, use_build_context_synchronously, duplicate_ignore
import 'dart:async';
import 'dart:convert';
import 'package:dio/dio.dart';
@@ -16,19 +15,22 @@ import 'package:kmobile/di/injection.dart';
import 'package:kmobile/features/fund_transfer/screens/payment_animation.dart';
import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart';
import '../../../l10n/app_localizations.dart';
import 'package:kmobile/api/services/payment_service.dart';
import 'package:kmobile/data/models/transfer.dart';
enum TransactionMode { neft, rtgs, imps }
class FundTransferAmountScreen extends StatefulWidget {
final String debitAccountNo;
final Beneficiary creditBeneficiary;
final String remitterName;
final bool isOwnBank;
const FundTransferAmountScreen({
super.key,
required this.debitAccountNo,
required this.creditBeneficiary,
required this.remitterName,
this.isOwnBank = false,
});
@override
@@ -36,7 +38,7 @@ class FundTransferAmountScreen extends StatefulWidget {
_FundTransferAmountScreenState();
}
class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
final _amountController = TextEditingController();
final _formKey = GlobalKey<FormState>();
TransactionMode _selectedMode = TransactionMode.neft;
@@ -50,232 +52,241 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
void _onProceed() {
if (_formKey.currentState!.validate()) {
final amount = double.tryParse(_amountController.text) ?? 0;
if (widget.isOwnBank) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TransactionPinScreen(
onPinCompleted: (pinScreenContext, tpin) async {
final transfer = Transfer(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
toAccountType: 'Savings', // Assuming 'SB' for savings
amount: _amountController.text,
tpin: tpin,
);
if (_selectedMode == TransactionMode.rtgs && amount < 200000) {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: Text(AppLocalizations.of(context).invalidRtgs),
content: Text(AppLocalizations.of(context).invalidRtgsPopUp),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: Text(AppLocalizations.of(context).ok),
),
],
final paymentService = getIt<PaymentService>();
final paymentResponseFuture =
paymentService.processQuickPayWithinBank(transfer);
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: paymentResponseFuture),
),
);
},
),
),
);
return; // Stop further execution
}
} else {
if (_selectedMode == TransactionMode.rtgs && amount < 200000) {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: Text(AppLocalizations.of(context).invalidRtgs),
content: Text(AppLocalizations.of(context).invalidRtgsPopUp),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: Text(AppLocalizations.of(context).ok),
),
],
),
);
return; // Stop further execution
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TransactionPinScreen(
onPinCompleted: (pinScreenContext, tpin) async {
if (_selectedMode == TransactionMode.neft) {
final neftTx = NeftTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
final neftService = getIt<NeftService>();
final completer = Completer<PaymentResponse>();
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final neftResponse =
await neftService.processNeftTransaction(neftTx);
final paymentResponse = PaymentResponse(
isSuccess: neftResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: neftTx.toAccount,
amount: neftTx.amount,
currency: 'INR',
utr: neftResponse.utr,
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TransactionPinScreen(
onPinCompleted: (pinScreenContext, tpin) async {
if (_selectedMode == TransactionMode.neft) {
final neftTx = NeftTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
print(e);
String errorMessage;
if (e.response != null && e.response!.data != null) {
print('error has data');
try {
// final error = jsonDecode(e.response!.toString())['error'];
final error = e.response?.data['error'];
print('actual error message $error');
errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
}[error] ??
"Something Went Wrong";
} catch (_) {
print('error extracting errorMessage');
final neftService = getIt<NeftService>();
final completer = Completer<PaymentResponse>();
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final neftResponse =
await neftService.processNeftTransaction(neftTx);
final paymentResponse = PaymentResponse(
isSuccess:
neftResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: neftTx.toAccount,
amount: neftTx.amount,
currency: 'INR',
utr: neftResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
String errorMessage;
if (e.response != null && e.response!.data != null) {
try {
// final error = jsonDecode(e.response!.toString())['error'];
final error = e.response?.data['error'];
errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
}[error] ??
"Something Went Wrong";
} catch (_) {
errorMessage = "Something Went Wrong";
}
} else {
errorMessage = "Something Went Wrong";
}
} else {
print('has has no data');
errorMessage = "Something Went Wrong";
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
if (!pinScreenContext.mounted) return;
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: AppLocalizations.of(pinScreenContext)
.somethingWentWrong,
);
completer.complete(paymentResponse);
}
print('PaymentResponse generating');
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
print('PaymentResponse generated');
print(paymentResponse);
completer.complete(paymentResponse);
print("NEFT transaction failed with DioException."); // Add
} catch (e) {
print('generic exception');
print(e.toString());
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: AppLocalizations.of(pinScreenContext)
.somethingWentWrong,
);
completer.complete(paymentResponse);
print(
"NEFT transaction failed with generic exception."); // Add
}
}
//IMPS transaction
else if (_selectedMode == TransactionMode.imps) {
final impsTx = ImpsTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
final impsService = getIt<ImpsService>();
final completer = Completer<PaymentResponse>();
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final impsResponse =
await impsService.processImpsTransaction(impsTx);
final paymentResponse = PaymentResponse(
isSuccess: impsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: impsTx.toAccount,
amount: impsTx.amount,
currency: 'INR',
utr: impsResponse.utr,
//IMPS transaction
else if (_selectedMode == TransactionMode.imps) {
final impsTx = ImpsTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
print('dio exception');
print(e.toString());
final impsService = getIt<ImpsService>();
final completer = Completer<PaymentResponse>();
final error = jsonDecode(e.response.toString())['error'];
var errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
}[error] ??
"Something Went Wrong";
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
print('generic exception');
print(e.toString());
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: "Something went Wrong",
);
completer.complete(paymentResponse);
try {
final impsResponse =
await impsService.processImpsTransaction(impsTx);
final paymentResponse = PaymentResponse(
isSuccess:
impsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: impsTx.toAccount,
amount: impsTx.amount,
currency: 'INR',
utr: impsResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
final error = jsonDecode(e.response.toString())['error'];
var errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
}[error] ??
"Something Went Wrong";
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: "Something went Wrong",
);
completer.complete(paymentResponse);
}
}
}
//RTGS
else {
final rtgsTx = RtgsTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
final rtgsService = getIt<RtgsService>();
final completer = Completer<PaymentResponse>();
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final rtgsResponse =
await rtgsService.processRtgsTransaction(rtgsTx);
final paymentResponse = PaymentResponse(
isSuccess: rtgsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: rtgsTx.toAccount,
amount: rtgsTx.amount,
currency: 'INR',
utr: rtgsResponse.utr,
//RTGS
else {
final rtgsTx = RtgsTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
print('dio exception');
print(e.toString());
final rtgsService = getIt<RtgsService>();
final completer = Completer<PaymentResponse>();
final error = jsonDecode(e.response.toString())['error'];
var errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
// ignore: use_build_context_synchronously
}[error] ??
"Something Went Wrong";
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
print('generic exception');
print(e.toString());
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: "Something Went Wrong",
);
completer.complete(paymentResponse);
try {
final rtgsResponse =
await rtgsService.processRtgsTransaction(rtgsTx);
final paymentResponse = PaymentResponse(
isSuccess:
rtgsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: rtgsTx.toAccount,
amount: rtgsTx.amount,
currency: 'INR',
utr: rtgsResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
final error = jsonDecode(e.response.toString())['error'];
var errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
// ignore: use_build_context_synchronously
}[error] ??
"Something Went Wrong";
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: "Something Went Wrong",
);
completer.complete(paymentResponse);
}
}
}
},
},
),
),
),
);
);
}
}
}
@@ -329,59 +340,61 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
),
const SizedBox(height: 24),
// 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),
if (!widget.isOwnBank) ...[
// Transaction Mode Selection
Text(
AppLocalizations.of(context).selectTransactionType,
style: Theme.of(context).textTheme.titleMedium,
),
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).primaryColor,
color: Theme.of(context).colorScheme.onSurface,
borderColor: Colors.transparent,
selectedBorderColor: Colors.transparent,
splashColor: Theme.of(context).primaryColor.withOpacity(0.1),
highlightColor:
Theme.of(context).primaryColor.withOpacity(0.05),
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: 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).primaryColor,
color: Theme.of(context).colorScheme.onSurface,
borderColor: Colors.transparent,
selectedBorderColor: Colors.transparent,
splashColor:
Theme.of(context).primaryColor,
highlightColor:
Theme.of(context).primaryColor,
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),
const SizedBox(height: 24),
],
// Amount
TextFormField(
controller: _amountController,
@@ -421,4 +434,4 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
),
);
}
}
}

View File

@@ -10,8 +10,12 @@ import 'package:shimmer/shimmer.dart';
class FundTransferBeneficiaryScreen extends StatefulWidget {
final String creditAccountNo;
final String remitterName;
final bool isOwnBank;
const FundTransferBeneficiaryScreen(
{super.key, required this.creditAccountNo, required this.remitterName});
{super.key,
required this.creditAccountNo,
required this.remitterName,
required this.isOwnBank});
@override
State<FundTransferBeneficiaryScreen> createState() =>
@@ -33,7 +37,12 @@ class _FundTransferBeneficiaryScreenState
Future<void> _loadBeneficiaries() async {
final data = await service.fetchBeneficiaryList();
setState(() {
_beneficiaries = data;
_beneficiaries = data
.where((b) => widget.isOwnBank
? b.bankName ==
'THE KANGRA CENTRAL CO-OP BANK LIMITED' // Assuming 'KCCB' is your bank's name
: b.bankName != 'THE KANGRA CENTRAL CO-OP BANK LIMITED')
.toList();
_isLoading = false;
});
}
@@ -100,6 +109,7 @@ class _FundTransferBeneficiaryScreenState
debitAccountNo: widget.creditAccountNo,
creditBeneficiary: beneficiary,
remitterName: widget.remitterName,
isOwnBank: widget.isOwnBank,
),
),
);

View File

@@ -1,153 +1,88 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_beneficiary_screen.dart';
import 'package:material_symbols_icons/symbols.dart';
import '../../../l10n/app_localizations.dart';
class FundTransferScreen extends StatefulWidget {
const FundTransferScreen({super.key});
class FundTransferScreen extends StatelessWidget {
final String creditAccountNo;
final String remitterName;
@override
State<FundTransferScreen> createState() => _FundTransferScreen();
}
class _FundTransferScreen extends State<FundTransferScreen> {
String amount = "";
void onKeyTap(String key) {
setState(() {
if (key == 'back') {
if (amount.isNotEmpty) {
amount = amount.substring(0, amount.length - 1);
}
} else if (key == 'done') {
if (kDebugMode) {
print('${AppLocalizations.of(context).amountEntered} $amount');
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const TransactionPinScreen(
// transactionData: {},
// transactionCode: 'TRANSFER'
// )));
}
} else {
amount += key;
}
});
}
Widget buildKey(String value) {
if (value == 'done') {
return GestureDetector(
onTap: () => onKeyTap(value),
child: const Icon(Symbols.check, size: 30),
);
} else if (value == 'back') {
return GestureDetector(
onTap: () => onKeyTap(value),
child: const Icon(Symbols.backspace, size: 30),
);
} else {
return GestureDetector(
onTap: () => onKeyTap(value),
child: Center(
child: Text(
value,
style: const TextStyle(fontSize: 24, color: Colors.black),
),
),
);
}
}
final keys = [
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'done',
'0',
'back',
];
const FundTransferScreen({
super.key,
required this.creditAccountNo,
required this.remitterName,
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Symbols.arrow_back_ios_new),
onPressed: () {
Navigator.pop(context);
},
),
title: Text(
AppLocalizations.of(context).fundTransfer,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
),
centerTitle: false,
actions: const [
Padding(
padding: EdgeInsets.only(right: 10.0),
child: CircleAvatar(
backgroundImage: AssetImage('assets/images/avatar.jpg'),
// Replace with your image
radius: 20,
),
),
],
title: Text(AppLocalizations.of(context).fundTransfer),
),
body: Column(
body: ListView(
children: [
const Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(AppLocalizations.of(context).debitFrom),
const Text(
'0300015678903456',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
),
],
FundTransferManagementTile(
icon: Symbols.input_circle,
label: AppLocalizations.of(context).ownBank,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FundTransferBeneficiaryScreen(
creditAccountNo: creditAccountNo,
remitterName: remitterName,
isOwnBank: true,
),
),
);
},
),
const SizedBox(height: 20),
Text(
AppLocalizations.of(context).enterAmount,
style: const TextStyle(fontSize: 20),
),
const SizedBox(height: 20),
Container(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
decoration: BoxDecoration(
color: Colors.grey.shade200,
borderRadius: BorderRadius.circular(12),
),
child: Text(
amount.isEmpty ? "0" : amount,
style: const TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
),
),
const Spacer(),
Container(
padding: const EdgeInsets.all(16.0),
color: Theme.of(context).scaffoldBackgroundColor,
child: GridView.count(
crossAxisCount: 3,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
mainAxisSpacing: 12,
crossAxisSpacing: 12,
childAspectRatio: 1.2,
children: keys.map((key) => buildKey(key)).toList(),
),
const Divider(height: 1),
FundTransferManagementTile(
icon: Symbols.output_circle,
label: AppLocalizations.of(context).outsideBank,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FundTransferBeneficiaryScreen(
creditAccountNo: creditAccountNo,
remitterName: remitterName,
isOwnBank: false,
),
),
);
},
),
const Divider(height: 1),
],
),
);
}
}
class FundTransferManagementTile extends StatelessWidget {
final IconData icon;
final String label;
final VoidCallback onTap;
final bool disable;
const FundTransferManagementTile({
super.key,
required this.icon,
required this.label,
required this.onTap,
this.disable = false,
});
@override
Widget build(BuildContext context) {
return ListTile(
leading: Icon(icon),
title: Text(label),
trailing: const Icon(Symbols.arrow_right, size: 20),
onTap: onTap,
enabled: !disable,
);
}
}

View File

@@ -22,7 +22,7 @@ class ColorThemeDialog extends StatelessWidget {
),
ListTile(
leading: const CircleAvatar(backgroundColor: Colors.green),
title: const Text('Green'),
title: Text(AppLocalizations.of(context).green),
onTap: () {
context.read<ThemeCubit>().changeTheme(ThemeType.green);
Navigator.pop(context);
@@ -30,7 +30,7 @@ class ColorThemeDialog extends StatelessWidget {
),
ListTile(
leading: const CircleAvatar(backgroundColor: Colors.orange),
title: const Text('Orange'),
title: Text(AppLocalizations.of(context).orange),
onTap: () {
context.read<ThemeCubit>().changeTheme(ThemeType.orange);
Navigator.pop(context);

View File

@@ -1,6 +1,5 @@
// ignore_for_file: use_build_context_synchronously
import 'dart:async';
import 'dart:developer';
import 'package:dio/dio.dart';
import 'package:flutter/services.dart';
import 'package:kmobile/api/services/imps_service.dart';
@@ -53,7 +52,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
accountType = AppLocalizations.of(context).savings;
accountType = 'Savings';
});
});
}
@@ -216,14 +215,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
);
completer.complete(paymentResponse);
} on DioException catch (e) {
print(e);
String errorMessage;
if (e.response != null && e.response!.data != null) {
print('error has data');
try {
// final error = jsonDecode(e.response!.toString())['error'];
final error = e.response?.data['error'];
print('actual error message $error');
errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
@@ -231,22 +227,16 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
}[error] ??
"Something Went Wrong";
} catch (_) {
print('error extracting errorMessage');
errorMessage = "Something Went Wrong";
}
} else {
print('has has no data');
errorMessage = "Something Went Wrong";
}
print('PaymentResponse generating');
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
print('PaymentResponse generated');
print(paymentResponse);
completer.complete(paymentResponse);
print("NEFT transaction failed with DioException."); // Add
} catch (e) {
final paymentResponse = PaymentResponse(
isSuccess: false,
@@ -269,6 +259,9 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
);
final impsService = getIt<ImpsService>();
final completer = Completer<PaymentResponse>();
if (!pinScreenContext.mounted) {
return;
}
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
@@ -290,9 +283,6 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
);
completer.complete(paymentResponse);
} on DioException catch (e) {
print('dio exception');
print(e.toString());
final error = e.response?.data['error'];
var errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
@@ -328,7 +318,9 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
);
final rtgsService = getIt<RtgsService>();
final completer = Completer<PaymentResponse>();
if (!pinScreenContext.mounted) {
return;
}
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
@@ -349,16 +341,13 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
);
completer.complete(paymentResponse);
} on DioException catch (e) {
print('dio exception');
print(e.toString());
log('dio exception');
final error = e.response?.data['error'];
var errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
// ignore: duplicate_ignore
// ignore: use_build_context_synchronously
}[error] ??
"Something Went Wrong";
@@ -572,8 +561,8 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
),
),
items: [
AppLocalizations.of(context).savings,
AppLocalizations.of(context).current,
'Savings',
'Current',
]
.map(
(e) => DropdownMenuItem(value: e, child: Text(e)),

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/features/quick_pay/screens/quick_pay_outside_bank_screen.dart';
import 'package:kmobile/features/quick_pay/screens/quick_pay_within_bank_screen.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
@@ -18,33 +17,9 @@ class _QuickPayScreen extends State<QuickPayScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Symbols.arrow_back_ios_new),
onPressed: () {
Navigator.pop(context);
},
),
title: Text(
AppLocalizations.of(context).quickPay.replaceAll('\n', ' '),
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
AppLocalizations.of(context).quickPay.replaceAll('\n', ''),
),
centerTitle: false,
actions: [
Padding(
padding: const EdgeInsets.only(right: 10.0),
child: CircleAvatar(
backgroundColor: Colors.grey[200],
radius: 20,
child: SvgPicture.asset(
'assets/images/avatar_male.svg',
width: 40,
height: 40,
fit: BoxFit.cover,
),
),
),
],
),
body: ListView(
children: [

View File

@@ -25,10 +25,10 @@
"hi": "Hi",
"kMobile": "kMobile",
"scanBiometric": "Scan to enable Biometric login",
"savingsAccount": "Savings Account",
"loanAccount": "Loan Account",
"termDeposit": "Term Deposit Account",
"recurringDeposit": "Recurring Deposit Account",
"savingsAccount": "Savings",
"loanAccount": "Loan",
"termDeposit": "Term Deposit",
"recurringDeposit": "Recurring Deposit",
"unknownAccount": "Unknown Account Type",
"customerInfo": "Customer \n Info",
"fundTransfer": "Fund \n Transfer",
@@ -241,7 +241,7 @@
"invalidRtgsPopUp": "RTGS transactions require a minimum amount of 200,000. Please enter a higher amount or select NEFT as the transaction mode.",
"correctTpin": "Please Enter the correct TPIN",
"insufficientFund": "Your account does not have sufficient balance",
"creditedTo": "Credited To",
"creditedTo": "Credit To",
"selectTransactionType": "Select transaction Type",
"proceed": "Proceed",
"plsValidateBeneficiary": "Please validate beneficiary details first",
@@ -250,6 +250,45 @@
"findnearbybranched": "Find nearby branches",
"searchbranch": "Search Branch",
"searchbranchby": "Search by Branch Name / Code / IFSC",
"branchsearchsoon": "Branch search coming soon..."
"branchsearchsoon": "Branch search coming soon...",
"loginFailed": "Login failed",
"invalidCredentials": "Invalid credentials",
"networkErrorDuringLogin": "Network error during login",
"unexpectedErrorDuringLogin": "Unexpected error during login",
"tokenRefreshFailed": "Token refresh failed",
"failedToRefreshToken": "Failed to refresh token",
"failedToCheckTpinStatus": "Failed to check TPIN status",
"networkErrorDuringTpinCheck": "Network error during TPIN check",
"unexpectedErrorDuringTpinCheck": "Unexpected error during TPIN check",
"failedToSetTpin": "Failed to set TPIN",
"networkErrorDuringTpinSetup": "Network error during TPIN setup",
"unexpectedErrorDuringTpinSetup": "Unexpected error during TPIN setup",
"failedToValidateBeneficiary": "Failed to validate beneficiary",
"networkError": "Network error",
"unexpectedError": "Unexpected error: ",
"invalidIfscCode": "INVALID IFSC CODE",
"invalidBeneficiaryDetails": "Invalid Beneficiary Details",
"failedToFetchBeneficiaries": "Failed to fetch beneficiaries",
"failedToDeleteBeneficiary": "Failed to delete beneficiary",
"impsTransactionFailedWithStatusCode": "IMPS transaction failed with status code: ",
"anUnexpectedErrorOccurred": "An unexpected error occurred: ",
"neftTransactionFailedWithStatusCode": "NEFT transaction failed with status code: ",
"unknownError": "Unknown error",
"failedToProcessQuickPayWithinBank": "Failed to process quick pay within bank: ",
"rtgsTransactionFailedWithStatusCode": "RTGS transaction failed with status code: ",
"failedToLoadCustomerDetails": "Failed to load customer details",
"routeNotFound": "Route not found!",
"pleaseValidateBeneficiaryDetailsFirst": "Please validate beneficiary details first.",
"beneficiaryAlreadyExists": "Beneficiary already exists",
"pleaseEnterAValidAndMatchingAccountNumber": "Please enter a valid and matching account number.",
"beneficiaryDeletedSuccessfully": "Beneficiary deleted successfully",
"areYouSureYouWantToDeleteThisBeneficiary": "Are you sure you want to delete this beneficiary?",
"yourAccountDoesNotHaveSufficientBalance": "Your account does not have sufficient balance",
"green": "Green",
"orange": "Orange",
"deleteBeneficiary": "Delete Beneficiary",
"beneficiarydetails": "Beneficiary Details",
"delete": "Delete",
"search": "Search",
"viewCardDeatils": "View Card Details"
}

View File

@@ -241,7 +241,7 @@
"invalidRtgsPopUp": "RTGS लेनदेन के लिए न्यूनतम 2,00,000 रुपये की राशि की आवश्यकता होती है। कृपया अधिक राशि दर्ज करें या लेनदेन मोड के रूप में NEFT चुनें",
"correctTpin": "कृपया सही टी-पिन दर्ज करें",
"insufficientFund": "आपके खाते में पर्याप्त शेष राशि नहीं है",
"creditedTo": "को श्रेय दिया गया",
"creditedTo": "को श्रेय",
"selectTransactionType": "लेन-देन का प्रकार चुनें",
"proceed": "आगे बढ़ना",
"plsValidateBeneficiary": "कृपया पहले लाभार्थी विवरण सत्यापित करें",
@@ -250,5 +250,45 @@
"findnearbybranched": "आस-पास की शाखाएँ खोजें",
"searchbranch": "शाखा खोजें",
"searchbranchby": "शाखा खोजें नाम / बैंक कोड / आईएफएससी द्वारा",
"branchsearchsoon": "शाखा खोज सुविधा जल्द ही आ रही है..."
"branchsearchsoon": "शाखा खोज सुविधा जल्द ही आ रही है...",
"loginFailed": "लॉगिन विफल",
"invalidCredentials": "अवैध प्रत्यय पत्र",
"networkErrorDuringLogin": "लॉगिन के दौरान नेटवर्क त्रुटि",
"unexpectedErrorDuringLogin": "लॉगिन के दौरान अप्रत्याशित त्रुटि",
"tokenRefreshFailed": "टोकन ताज़ा विफल रहा",
"failedToRefreshToken": "टोकन रीफ़्रेश करने में विफल",
"failedToCheckTpinStatus": "टी-पिन स्थिति की जाँच करने में विफल",
"networkErrorDuringTpinCheck": "टी-पिन जाँच के दौरान नेटवर्क त्रुटि",
"unexpectedErrorDuringTpinCheck": "TPIN जाँच के दौरान अप्रत्याशित त्रुटि",
"failedToSetTpin": "Tpin सेट करने में विफल",
"networkErrorDuringTpinSetup": "Tpin सेटअप के दौरान नेटवर्क त्रुटि",
"unexpectedErrorDuringTpinSetup": "TPIN सेटअप के दौरान अप्रत्याशित त्रुटि",
"failedToValidateBeneficiary": "लाभार्थी को सत्यापित करने में विफल",
"networkError": "नेटवर्क त्रुटि",
"unexpectedError": "अप्रत्याशित त्रुटि:",
"invalidIfscCode": "अमान्य IFSC कोड",
"invalidBeneficiaryDetails": "अमान्य लाभार्थी विवरण",
"failedToFetchBeneficiaries": "लाभार्थियों को प्राप्त करने में विफल",
"failedToDeleteBeneficiary": "लाभार्थी को हटाने में विफल",
"impsTransactionFailedWithStatusCode": "IMPS लेन-देन स्थिति कोड के साथ विफल:",
"anUnexpectedErrorOccurred": "एक अप्रत्याशित त्रुटि हुई:",
"neftTransactionFailedWithStatusCode": "NEFT लेन-देन स्थिति कोड के साथ विफल:",
"unknownError": "अज्ञात त्रुटि",
"failedToProcessQuickPayWithinBank": "बैंक के भीतर क्विक पे संसाधित करने में विफल:",
"rtgsTransactionFailedWithStatusCode": "RTGS लेन-देन स्थिति कोड के साथ विफल:",
"failedToLoadCustomerDetails": "ग्राहक विवरण लोड करने में विफल",
"routeNotFound": "रूट नहीं मिला!",
"pleaseValidateBeneficiaryDetailsFirst": "कृपया पहले लाभार्थी विवरण सत्यापित करें।",
"beneficiaryAlreadyExists": "लाभार्थी पहले से मौजूद है",
"pleaseEnterAValidAndMatchingAccountNumber": "कृपया एक मान्य और मिलान करने वाला खाता संख्या दर्ज करें।",
"beneficiaryDeletedSuccessfully": "लाभार्थी सफलतापूर्वक हटाया गया।",
"areYouSureYouWantToDeleteThisBeneficiary": "क्या आप वाकई इस लाभार्थी को हटाना चाहते हैं?",
"yourAccountDoesNotHaveSufficientBalance": "आपके खाते में पर्याप्त शेष राशि नहीं है",
"green": "हरा",
"orange": "नारंगी",
"deleteBeneficiary": "लाभार्थी हटाएं",
"beneficiarydetails": "लाभार्थी विवरण",
"delete": "मिटाओ",
"search": "खोजें",
"viewCardDeatils": "कार्ड विवरण देखें"
}

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:jailbreak_root_detection/jailbreak_root_detection.dart';
import 'package:kmobile/rooted_screen.dart';
import 'di/injection.dart';
import 'app.dart';
@@ -14,5 +16,17 @@ void main() async {
// Initialize dependencies
await setupDependencies();
final isJailBroken = await JailbreakRootDetection.instance.isJailBroken;
final isRealDevice = await JailbreakRootDetection.instance.isRealDevice;
if(isJailBroken || !isRealDevice){
runApp(const MaterialApp(
home: RootedScreen(),
debugShowCheckedModeBanner: false,
)
);
}
else{
runApp(const KMobile());
}
}

56
lib/rooted_screen.dart Normal file
View File

@@ -0,0 +1,56 @@
import 'package:flutter/material.dart';
class RootedScreen extends StatelessWidget {
const RootedScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: Center(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(
Icons.warning_amber_rounded,
color: Colors.red,
size: 80,
),
const SizedBox(height: 20),
const Text(
"Rooted Device Detected",
style: TextStyle(
color: Colors.red,
fontSize: 22,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 15),
const Text(
"For security reasons, this app cannot run on rooted devices.",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white70,
fontSize: 16,
),
),
const SizedBox(height: 30),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red,
foregroundColor: Colors.white,
),
onPressed: () {
// Optionally close the app
},
child: const Text("Exit"),
),
],
),
),
),
);
}
}

View File

@@ -10,7 +10,7 @@ Widget getBankLogo(String? bankName) {
}
if (bankName != null && bankName.toLowerCase().contains('kangra central')) {
return Image.asset(
'assets/images/icon.png',
'assets/images/logo.png',
width: 40,
height: 40,
);

View File

@@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.13.0"
version: "2.11.0"
bloc:
dependency: "direct main"
description:
@@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
chalkdart:
dependency: transitive
description:
@@ -53,10 +53,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.3.0"
checked_yaml:
dependency: transitive
description:
@@ -77,18 +77,18 @@ packages:
dependency: transitive
description:
name: clock
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.19.1"
version: "1.18.0"
confetti:
dependency: "direct main"
description:
@@ -149,10 +149,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
version: "1.3.1"
ffi:
dependency: transitive
description:
@@ -353,10 +353,18 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.20.2"
version: "0.19.0"
jailbreak_root_detection:
dependency: "direct main"
description:
name: jailbreak_root_detection
sha256: c611229940a09785bd686364e92a40b07724926d2496c931527805101eb3da86
url: "https://pub.dev"
source: hosted
version: "1.1.6"
js:
dependency: transitive
description:
@@ -377,18 +385,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.9"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
@@ -457,10 +465,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
@@ -481,10 +489,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.15.0"
mime:
dependency: transitive
description:
@@ -505,10 +513,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.9.0"
path_parsing:
dependency: transitive
description:
@@ -689,15 +697,15 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.10.1"
version: "1.10.0"
sprintf:
dependency: transitive
description:
@@ -710,42 +718,42 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.12.1"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.4.1"
version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted
version: "1.2.2"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.4"
version: "0.7.2"
typed_data:
dependency: transitive
description:
@@ -862,10 +870,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "15.0.0"
version: "14.2.5"
web:
dependency: transitive
description:
@@ -907,5 +915,5 @@ packages:
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.7.0-0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"

View File

@@ -59,6 +59,8 @@ dependencies:
lottie: ^2.6.0
share_plus: ^7.2.1
confetti: ^0.7.0
jailbreak_root_detection: "^1.1.6"