48 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
asif
eb0e1c120e Changed font size in transaction detail screen 2025-08-26 21:03:28 +05:30
a64e68d642 NEFT and RTGS transaction error resolved, 2025-08-26 16:42:30 +05:30
80faa06272 Merge branch 'uat-2' of https://7o9o-lb-526275444.ap-south-1.elb.amazonaws.com/md.asif5/kmobile into uat-2 2025-08-26 16:00:26 +05:30
0bab68a2e6 NEFT and RTGS transaction error resolved 2025-08-26 15:58:31 +05:30
asif
351ee84414 formatted some files 2025-08-25 19:47:19 +05:30
asif
f77549310a Changed some formatting issues 2025-08-25 19:45:20 +05:30
4b28a113d4 color Changes minor 2025-08-25 18:10:52 +05:30
38 changed files with 1289 additions and 766 deletions

View File

@@ -25,7 +25,7 @@ if (flutterVersionName == null) {
android { android {
namespace "com.example.kmobile" namespace "com.example.kmobile"
compileSdk flutter.compileSdkVersion compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion ndkVersion "27.0.12077973"
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
@@ -53,9 +53,13 @@ android {
buildTypes { buildTypes {
release { 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. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // 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,3 +1,5 @@
// ignore_for_file: unused_local_variable
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import '../../data/repositories/auth_repository.dart'; import '../../data/repositories/auth_repository.dart';

View File

@@ -1,5 +1,4 @@
import 'dart:developer'; import 'dart:developer';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:kmobile/data/models/ifsc.dart'; import 'package:kmobile/data/models/ifsc.dart';
import 'package:kmobile/data/models/beneficiary.dart'; import 'package:kmobile/data/models/beneficiary.dart';
@@ -105,4 +104,18 @@ class BeneficiaryService {
return []; 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

@@ -29,5 +29,3 @@ class ImpsService {
} }
} }
} }

View File

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

View File

@@ -1,5 +1,4 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:kmobile/data/models/imps_transaction.dart';
import 'package:kmobile/data/models/rtgs_response.dart'; import 'package:kmobile/data/models/rtgs_response.dart';
import 'package:kmobile/data/models/rtgs_transaction.dart'; import 'package:kmobile/data/models/rtgs_transaction.dart';
@@ -29,6 +28,4 @@ class RtgsService {
throw Exception('An unexpected error occurred: ${e.toString()}'); throw Exception('An unexpected error occurred: ${e.toString()}');
} }
} }
processImpsTransaction(ImpsTransaction impsTx) {}
} }

View File

@@ -11,7 +11,7 @@ import 'config/routes.dart';
import 'di/injection.dart'; import 'di/injection.dart';
import 'features/auth/controllers/auth_cubit.dart'; import 'features/auth/controllers/auth_cubit.dart';
import 'features/card/screens/card_management_screen.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/auth/screens/login_screen.dart';
import 'features/service/screens/service_screen.dart'; import 'features/service/screens/service_screen.dart';
import 'features/dashboard/screens/dashboard_screen.dart'; import 'features/dashboard/screens/dashboard_screen.dart';
@@ -40,7 +40,7 @@ class _KMobileState extends State<KMobile> {
void initState() { void initState() {
super.initState(); super.initState();
loadPreferences(); loadPreferences();
Future.delayed(const Duration(seconds: 2), () { Future.delayed(const Duration(seconds: 3), () {
setState(() { setState(() {
showSplash = false; showSplash = false;
}); });
@@ -67,7 +67,6 @@ class _KMobileState extends State<KMobile> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// Set status bar color and brightness
SystemChrome.setSystemUIOverlayStyle( SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle( const SystemUiOverlayStyle(
statusBarColor: Colors.transparent, statusBarColor: Colors.transparent,
@@ -119,7 +118,6 @@ class AuthGate extends StatefulWidget {
class _AuthGateState extends State<AuthGate> { class _AuthGateState extends State<AuthGate> {
bool _checking = true; bool _checking = true;
bool _isLoggedIn = false; bool _isLoggedIn = false;
bool _showWelcome = true;
bool _hasMPin = false; bool _hasMPin = false;
bool _biometricEnabled = false; bool _biometricEnabled = false;
bool _biometricTried = false; bool _biometricTried = false;
@@ -175,18 +173,7 @@ class _AuthGateState extends State<AuthGate> {
if (_checking) { if (_checking) {
return const SplashScreen(); 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 (_isLoggedIn) {
if (_hasMPin) { if (_hasMPin) {
if (_biometricEnabled) { if (_biometricEnabled) {
@@ -201,7 +188,6 @@ class _AuthGateState extends State<AuthGate> {
return const NavigationScaffold(); // Authenticated return const NavigationScaffold(); // Authenticated
} }
// ❌ Biometric failed → Show MPIN screen
return MPinScreen( return MPinScreen(
mode: MPinMode.enter, mode: MPinMode.enter,
onCompleted: (_) { onCompleted: (_) {
@@ -227,7 +213,6 @@ class _AuthGateState extends State<AuthGate> {
); );
} }
} else { } else {
// No MPIN set → show MPIN set screen + biometric dialog
return MPinScreen( return MPinScreen(
mode: MPinMode.set, mode: MPinMode.set,
onCompleted: (_) async { onCompleted: (_) async {
@@ -289,8 +274,6 @@ class _AuthGateState extends State<AuthGate> {
); );
} }
} }
// ✅ Step 3: If not logged in, show login screen
return const LoginScreen(); 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 // Add this widget at the end of the file
class BiometricPromptScreen extends StatelessWidget { class BiometricPromptScreen extends StatelessWidget {
final VoidCallback onCompleted; final VoidCallback onCompleted;
@@ -466,6 +426,9 @@ class BiometricPromptScreen extends StatelessWidget {
], ],
), ),
); );
if (!context.mounted) {
return;
}
if (result == true) { if (result == true) {
await _handleBiometric(context); await _handleBiometric(context);
} else { } else {

View File

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

View File

@@ -1,41 +1,39 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'theme_type.dart'; import 'theme_type.dart';
import 'package:google_fonts/google_fonts.dart';
class AppThemes { class AppThemes {
static ThemeData getLightTheme(ThemeType type) { static ThemeData getLightTheme(ThemeType type) {
// Define a seed color based on the theme type final Color seedColor;
final Color seedColor; switch (type) {
switch (type) { case ThemeType.green:
case ThemeType.green: seedColor = Colors.green;
seedColor = Colors.green; break;
break; case ThemeType.orange:
case ThemeType.orange: seedColor = Colors.orange;
seedColor = Colors.orange; break;
break; case ThemeType.blue:
case ThemeType.blue: seedColor = Colors.blue;
seedColor = Colors.blue; break;
break; case ThemeType.violet:
case ThemeType.violet: seedColor = Colors.deepPurple;
default: break;
seedColor = Colors.deepPurple; }
break;
}
// Create a ColorScheme from the seed color final colorScheme = ColorScheme.fromSeed(
final colorScheme = ColorScheme.fromSeed( seedColor: seedColor,
seedColor: seedColor, brightness: Brightness.light, // Explicitly set for a light theme
brightness: Brightness.light, // Explicitly set for a light theme );
);
// Create the ThemeData from the ColorScheme return ThemeData.from(
return ThemeData.from( colorScheme: colorScheme,
colorScheme: colorScheme, useMaterial3: true, // Recommended for modern Flutter apps
useMaterial3: true, // Recommended for modern Flutter apps textTheme: GoogleFonts.rubikTextTheme())
).copyWith( .copyWith(
scaffoldBackgroundColor: Colors.white, scaffoldBackgroundColor: Colors.white,
bottomNavigationBarTheme: BottomNavigationBarThemeData( bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: colorScheme.surface, backgroundColor: colorScheme.surface,
), ),
); );
} }
} }

View File

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

View File

@@ -62,7 +62,7 @@ Dio _createDioClient() {
BaseOptions( BaseOptions(
baseUrl: baseUrl:
'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', 'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080',
// 'http://localhost:8081', //'http://localhost:8081',
connectTimeout: const Duration(seconds: 5), connectTimeout: const Duration(seconds: 5),
receiveTimeout: const Duration(seconds: 10), receiveTimeout: const Duration(seconds: 10),
headers: { headers: {

View File

@@ -1,7 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/data/models/user.dart'; import 'package:kmobile/data/models/user.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
class AccountInfoScreen extends StatefulWidget { class AccountInfoScreen extends StatefulWidget {
@@ -32,35 +30,9 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
int selectedIndex = widget.selectedIndex; int selectedIndex = widget.selectedIndex;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: const Icon(Symbols.arrow_back_ios_new),
onPressed: () {
Navigator.pop(context);
},
),
title: Text( title: Text(
AppLocalizations.of(context).accountInfo, 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( body: ListView(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
@@ -70,7 +42,6 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 14), style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 14),
), ),
/// Dropdown to change account
DropdownButton<User>( DropdownButton<User>(
value: selectedUser, value: selectedUser,
onChanged: (User? newUser) { onChanged: (User? newUser) {
@@ -130,6 +101,7 @@ class InfoRow extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context);
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: const EdgeInsets.symmetric(vertical: 8), margin: const EdgeInsets.symmetric(vertical: 8),
@@ -138,16 +110,16 @@ class InfoRow extends StatelessWidget {
children: [ children: [
Text( Text(
title, title,
style: const TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.black87, color: theme.colorScheme.onSurfaceVariant,
), ),
), ),
const SizedBox(height: 3), const SizedBox(height: 3),
Text( Text(
value, 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 { class AccountStatementScreen extends StatefulWidget {
final String accountNo; final String accountNo;
const AccountStatementScreen({super.key, required this.accountNo}); final String balance;
const AccountStatementScreen({
super.key,
required this.accountNo,
required this.balance,
});
@override @override
State<AccountStatementScreen> createState() => _AccountStatementScreen(); State<AccountStatementScreen> createState() => _AccountStatementScreen();
@@ -150,7 +155,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
Text( Text(
"${AppLocalizations.of(context).accountNumber}: ", "${AppLocalizations.of(context).accountNumber}: ",
style: const TextStyle( style: const TextStyle(
fontSize: 19, fontSize: 17,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
@@ -158,6 +163,19 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
], ],
), ),
const SizedBox(height: 15), 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( Text(
AppLocalizations.of(context).filters, AppLocalizations.of(context).filters,
style: const TextStyle(fontSize: 17), style: const TextStyle(fontSize: 17),
@@ -196,7 +214,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),
), ),
child: Text( child: Text(
"Search", AppLocalizations.of(context).search,
style: TextStyle( style: TextStyle(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
fontSize: 16, fontSize: 16,
@@ -275,21 +293,21 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
tx.type == 'CR' ? Colors.green : Colors.red, tx.type == 'CR' ? Colors.green : Colors.red,
), ),
title: Text( title: Text(
tx.date ?? '', tx.date ?? '',
style: const TextStyle(fontSize: 15), style: const TextStyle(fontSize: 15),
), ),
subtitle: Text( subtitle: Text(
tx.name != null tx.name != null
? (tx.name!.length > 18 ? (tx.name!.length > 18
? tx.name!.substring(0, 22) ? tx.name!.substring(0, 22)
: tx.name!) : tx.name!)
: '', : '',
style: const TextStyle(fontSize: 12), style: const TextStyle(fontSize: 12),
), ),
trailing: Text( trailing: Text(
"${tx.amount}", "${tx.amount}",
style: const TextStyle(fontSize: 17), style: const TextStyle(fontSize: 17),
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@@ -302,8 +320,8 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
); );
}, },
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return const Divider(); return const Divider();
}, },
), ),
), ),
], ],

View File

@@ -93,14 +93,14 @@ class TransactionDetailsScreen extends StatelessWidget {
"$label: ", "$label: ",
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 20, fontSize: 17,
), ),
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: const TextStyle(fontSize: 20), style: const TextStyle(fontSize: 16),
), ),
), ),
], ],

View File

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

View File

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

View File

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

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:flutter/material.dart';
import 'package:kmobile/data/models/beneficiary.dart'; import 'package:kmobile/data/models/beneficiary.dart';
import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.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 '../../../l10n/app_localizations.dart';
import '../../../di/injection.dart'; import '../../../di/injection.dart';
import 'package:kmobile/api/services/beneficiary_service.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/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:kmobile/features/card/screens/block_card_screen.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:kmobile/features/card/screens/card_pin_change_details_screen.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart'; import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
@@ -64,11 +65,24 @@ class _CardManagementScreen extends State<CardManagementScreen> {
CardManagementTile( CardManagementTile(
icon: Symbols.password_2, icon: Symbols.password_2,
label: AppLocalizations.of(context).changeCardPin, 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: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const CardPinChangeDetailsScreen(), builder: (context) => const CardDetailsScreen(),
), ),
); );
}, },
@@ -80,6 +94,7 @@ class _CardManagementScreen extends State<CardManagementScreen> {
} }
} }
class CardManagementTile extends StatelessWidget { class CardManagementTile extends StatelessWidget {
final IconData icon; final IconData icon;
final String label; final String label;

View File

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

View File

@@ -50,7 +50,7 @@ class AccountCard extends StatelessWidget {
Text( Text(
account.accountNumber, account.accountNumber,
style: TextStyle( style: TextStyle(
color: const DialogThemeData().backgroundColor, fontSize: 16), color: Theme.of(context).scaffoldBackgroundColor, fontSize: 16),
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
Text( Text(
@@ -65,7 +65,7 @@ class AccountCard extends StatelessWidget {
Text( Text(
AppLocalizations.of(context).availableBalance, AppLocalizations.of(context).availableBalance,
style: TextStyle( style: TextStyle(
color: const DialogThemeData().backgroundColor, fontSize: 16), color: Theme.of(context).scaffoldBackgroundColor, fontSize: 16),
), ),
], ],
), ),

View File

@@ -1,4 +1,3 @@
// ignore_for_file: avoid_print, use_build_context_synchronously, duplicate_ignore
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; 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/payment_animation.dart';
import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart'; import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart';
import '../../../l10n/app_localizations.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 } enum TransactionMode { neft, rtgs, imps }
class FundTransferAmountScreen extends StatefulWidget { class FundTransferAmountScreen extends StatefulWidget {
final String debitAccountNo; final String debitAccountNo;
final Beneficiary creditBeneficiary; final Beneficiary creditBeneficiary;
final String remitterName; final String remitterName;
final bool isOwnBank;
const FundTransferAmountScreen({ const FundTransferAmountScreen({
super.key, super.key,
required this.debitAccountNo, required this.debitAccountNo,
required this.creditBeneficiary, required this.creditBeneficiary,
required this.remitterName, required this.remitterName,
this.isOwnBank = false,
}); });
@override @override
@@ -36,7 +38,7 @@ class FundTransferAmountScreen extends StatefulWidget {
_FundTransferAmountScreenState(); _FundTransferAmountScreenState();
} }
class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> { class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
final _amountController = TextEditingController(); final _amountController = TextEditingController();
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
TransactionMode _selectedMode = TransactionMode.neft; TransactionMode _selectedMode = TransactionMode.neft;
@@ -50,217 +52,241 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
void _onProceed() { void _onProceed() {
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
final amount = double.tryParse(_amountController.text) ?? 0; 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) { final paymentService = getIt<PaymentService>();
showDialog( final paymentResponseFuture =
context: context, paymentService.processQuickPayWithinBank(transfer);
builder: (ctx) => AlertDialog(
title: Text(AppLocalizations.of(context).invalidRtgs), Navigator.of(pinScreenContext).pushReplacement(
content: Text(AppLocalizations.of(context).invalidRtgsPopUp), MaterialPageRoute(
actions: [ builder: (_) => PaymentAnimationScreen(
TextButton( paymentResponse: paymentResponseFuture),
onPressed: () => Navigator.of(ctx).pop(), ),
child: Text(AppLocalizations.of(context).ok), );
), },
], ),
), ),
); );
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( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => TransactionPinScreen( builder: (context) => TransactionPinScreen(
onPinCompleted: (pinScreenContext, tpin) async { onPinCompleted: (pinScreenContext, tpin) async {
if (_selectedMode == TransactionMode.neft) { if (_selectedMode == TransactionMode.neft) {
final neftTx = NeftTransaction( final neftTx = NeftTransaction(
fromAccount: widget.debitAccountNo, fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo, toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text, amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode, ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName, remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name, beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin, 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,
); );
completer.complete(paymentResponse); final neftService = getIt<NeftService>();
} on DioException catch (e) { final completer = Completer<PaymentResponse>();
print('dio exception');
print(e.toString());
final error = jsonDecode(e.response.toString())['error']; Navigator.of(pinScreenContext).pushReplacement(
var errorMessage = { MaterialPageRoute(
"INCORRECT_TPIN": builder: (_) => PaymentAnimationScreen(
AppLocalizations.of(context).correctTpin, paymentResponse: completer.future),
"INSUFFICIENT_FUNDS": ),
AppLocalizations.of(context).insufficientFund );
}[error] ??
AppLocalizations.of(context).somethingWentWrong;
final paymentResponse = PaymentResponse( try {
isSuccess: false, final neftResponse =
errorMessage: errorMessage, await neftService.processNeftTransaction(neftTx);
); final paymentResponse = PaymentResponse(
completer.complete(paymentResponse); isSuccess:
} catch (e) { neftResponse.message.toUpperCase() == 'SUCCESS',
print('generic exception'); date: DateTime.now(),
print(e.toString()); creditedAccount: neftTx.toAccount,
final paymentResponse = PaymentResponse( amount: neftTx.amount,
isSuccess: false, currency: 'INR',
errorMessage: utr: neftResponse.utr,
AppLocalizations.of(context).somethingWentWrong, );
); completer.complete(paymentResponse);
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";
}
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);
}
} }
} //IMPS transaction
else if (_selectedMode == TransactionMode.imps) {
//IMPS transaction final impsTx = ImpsTransaction(
else if (_selectedMode == TransactionMode.imps) { fromAccount: widget.debitAccountNo,
final impsTx = ImpsTransaction( toAccount: widget.creditBeneficiary.accountNo,
fromAccount: widget.debitAccountNo, amount: _amountController.text,
toAccount: widget.creditBeneficiary.accountNo, ifscCode: widget.creditBeneficiary.ifscCode,
amount: _amountController.text, remitterName: widget.remitterName,
ifscCode: widget.creditBeneficiary.ifscCode, beneficiaryName: widget.creditBeneficiary.name,
remitterName: widget.remitterName, tpin: tpin,
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,
); );
completer.complete(paymentResponse); final impsService = getIt<ImpsService>();
} on DioException catch (e) { final completer = Completer<PaymentResponse>();
print('dio exception');
print(e.toString());
final error = jsonDecode(e.response.toString())['error']; Navigator.of(pinScreenContext).pushReplacement(
var errorMessage = { MaterialPageRoute(
"INCORRECT_TPIN": "Please Enter the correct TPIN", builder: (_) => PaymentAnimationScreen(
"INSUFFICIENT_FUNDS": paymentResponse: completer.future),
"Your account does not have sufficient balance" ),
}[error] ?? );
"Something Went Wrong";
final paymentResponse = PaymentResponse( try {
isSuccess: false, final impsResponse =
errorMessage: errorMessage, await impsService.processImpsTransaction(impsTx);
); final paymentResponse = PaymentResponse(
completer.complete(paymentResponse); isSuccess:
} catch (e) { impsResponse.message.toUpperCase() == 'SUCCESS',
print('generic exception'); date: DateTime.now(),
print(e.toString()); creditedAccount: impsTx.toAccount,
final paymentResponse = PaymentResponse( amount: impsTx.amount,
isSuccess: false, currency: 'INR',
errorMessage: "Something went Wrong", utr: impsResponse.utr,
); );
completer.complete(paymentResponse); 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);
}
} }
} else { //RTGS
final rtgsTx = RtgsTransaction( else {
fromAccount: widget.debitAccountNo, final rtgsTx = RtgsTransaction(
toAccount: widget.creditBeneficiary.accountNo, fromAccount: widget.debitAccountNo,
amount: _amountController.text, toAccount: widget.creditBeneficiary.accountNo,
ifscCode: widget.creditBeneficiary.ifscCode, amount: _amountController.text,
remitterName: widget.remitterName, ifscCode: widget.creditBeneficiary.ifscCode,
beneficiaryName: widget.creditBeneficiary.name, remitterName: widget.remitterName,
tpin: tpin, 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,
); );
completer.complete(paymentResponse); final rtgsService = getIt<RtgsService>();
} on DioException catch (e) { final completer = Completer<PaymentResponse>();
print('dio exception');
print(e.toString());
final error = jsonDecode(e.response.toString())['error']; Navigator.of(pinScreenContext).pushReplacement(
var errorMessage = { MaterialPageRoute(
"INCORRECT_TPIN": builder: (_) => PaymentAnimationScreen(
AppLocalizations.of(context).correctTpin, paymentResponse: completer.future),
"INSUFFICIENT_FUNDS": ),
AppLocalizations.of(context).insufficientFund );
// ignore: use_build_context_synchronously
}[error] ??
AppLocalizations.of(context).somethingWentWrong;
final paymentResponse = PaymentResponse( try {
isSuccess: false, final rtgsResponse =
errorMessage: errorMessage, await rtgsService.processRtgsTransaction(rtgsTx);
); final paymentResponse = PaymentResponse(
completer.complete(paymentResponse); isSuccess:
} catch (e) { rtgsResponse.message.toUpperCase() == 'SUCCESS',
print('generic exception'); date: DateTime.now(),
print(e.toString()); creditedAccount: rtgsTx.toAccount,
final paymentResponse = PaymentResponse( amount: rtgsTx.amount,
isSuccess: false, currency: 'INR',
errorMessage: utr: rtgsResponse.utr,
AppLocalizations.of(context).somethingWentWrong, );
); completer.complete(paymentResponse);
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);
}
} }
} },
}, ),
), ),
), );
); }
} }
} }
@@ -314,59 +340,61 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
// Transaction Mode Selection if (!widget.isOwnBank) ...[
Text( // Transaction Mode Selection
AppLocalizations.of(context).selectTransactionType, Text(
style: Theme.of(context).textTheme.titleMedium, 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: 12),
isSelected: [ Container(
_selectedMode == TransactionMode.neft, decoration: BoxDecoration(
_selectedMode == TransactionMode.rtgs, color: Theme.of(context).cardColor,
_selectedMode == TransactionMode.imps, borderRadius: BorderRadius.circular(12),
], border: Border.all(color: Colors.grey.shade300),
onPressed: (index) { ),
setState(() { child: ToggleButtons(
_selectedMode = TransactionMode.values[index]; isSelected: [
}); _selectedMode == TransactionMode.neft,
}, _selectedMode == TransactionMode.rtgs,
borderRadius: BorderRadius.circular(10), _selectedMode == TransactionMode.imps,
selectedColor: Theme.of(context).colorScheme.onPrimary, ],
fillColor: Theme.of(context).primaryColor, onPressed: (index) {
color: Theme.of(context).colorScheme.onSurface, setState(() {
borderColor: Colors.transparent, _selectedMode = TransactionMode.values[index];
selectedBorderColor: Colors.transparent, });
splashColor: Theme.of(context).primaryColor.withOpacity(0.1), },
highlightColor: borderRadius: BorderRadius.circular(10),
Theme.of(context).primaryColor.withOpacity(0.05), selectedColor: Theme.of(context).colorScheme.onPrimary,
children: [ fillColor: Theme.of(context).primaryColor,
Padding( color: Theme.of(context).colorScheme.onSurface,
padding: const EdgeInsets.symmetric( borderColor: Colors.transparent,
horizontal: 24.0, vertical: 12.0), selectedBorderColor: Colors.transparent,
child: Text(AppLocalizations.of(context).neft), splashColor:
), Theme.of(context).primaryColor,
Padding( highlightColor:
padding: const EdgeInsets.symmetric( Theme.of(context).primaryColor,
horizontal: 24.0, vertical: 12.0), children: [
child: Text(AppLocalizations.of(context).rtgs), Padding(
), padding: const EdgeInsets.symmetric(
Padding( horizontal: 24.0, vertical: 12.0),
padding: const EdgeInsets.symmetric( child: Text(AppLocalizations.of(context).neft),
horizontal: 24.0, vertical: 12.0), ),
child: Text(AppLocalizations.of(context).imps), 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 // Amount
TextFormField( TextFormField(
controller: _amountController, controller: _amountController,

View File

@@ -10,8 +10,12 @@ import 'package:shimmer/shimmer.dart';
class FundTransferBeneficiaryScreen extends StatefulWidget { class FundTransferBeneficiaryScreen extends StatefulWidget {
final String creditAccountNo; final String creditAccountNo;
final String remitterName; final String remitterName;
final bool isOwnBank;
const FundTransferBeneficiaryScreen( const FundTransferBeneficiaryScreen(
{super.key, required this.creditAccountNo, required this.remitterName}); {super.key,
required this.creditAccountNo,
required this.remitterName,
required this.isOwnBank});
@override @override
State<FundTransferBeneficiaryScreen> createState() => State<FundTransferBeneficiaryScreen> createState() =>
@@ -33,7 +37,12 @@ class _FundTransferBeneficiaryScreenState
Future<void> _loadBeneficiaries() async { Future<void> _loadBeneficiaries() async {
final data = await service.fetchBeneficiaryList(); final data = await service.fetchBeneficiaryList();
setState(() { 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; _isLoading = false;
}); });
} }
@@ -100,6 +109,7 @@ class _FundTransferBeneficiaryScreenState
debitAccountNo: widget.creditAccountNo, debitAccountNo: widget.creditAccountNo,
creditBeneficiary: beneficiary, creditBeneficiary: beneficiary,
remitterName: widget.remitterName, remitterName: widget.remitterName,
isOwnBank: widget.isOwnBank,
), ),
), ),
); );

View File

@@ -1,153 +1,88 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.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'; import '../../../l10n/app_localizations.dart';
class FundTransferScreen extends StatefulWidget { class FundTransferScreen extends StatelessWidget {
const FundTransferScreen({super.key}); final String creditAccountNo;
final String remitterName;
@override const FundTransferScreen({
State<FundTransferScreen> createState() => _FundTransferScreen(); super.key,
} required this.creditAccountNo,
required this.remitterName,
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',
];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton( title: Text(AppLocalizations.of(context).fundTransfer),
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,
),
),
],
), ),
body: Column( body: ListView(
children: [ children: [
const Spacer(), FundTransferManagementTile(
Row( icon: Symbols.input_circle,
mainAxisAlignment: MainAxisAlignment.center, label: AppLocalizations.of(context).ownBank,
children: [ onTap: () {
Text(AppLocalizations.of(context).debitFrom), Navigator.push(
const Text( context,
'0300015678903456', MaterialPageRoute(
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500), builder: (context) => FundTransferBeneficiaryScreen(
), creditAccountNo: creditAccountNo,
], remitterName: remitterName,
isOwnBank: true,
),
),
);
},
), ),
const SizedBox(height: 20), const Divider(height: 1),
Text( FundTransferManagementTile(
AppLocalizations.of(context).enterAmount, icon: Symbols.output_circle,
style: const TextStyle(fontSize: 20), label: AppLocalizations.of(context).outsideBank,
), onTap: () {
const SizedBox(height: 20), Navigator.push(
Container( context,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16), MaterialPageRoute(
decoration: BoxDecoration( builder: (context) => FundTransferBeneficiaryScreen(
color: Colors.grey.shade200, creditAccountNo: creditAccountNo,
borderRadius: BorderRadius.circular(12), remitterName: remitterName,
), isOwnBank: false,
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),
], ],
), ),
); );
} }
} }
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( ListTile(
leading: const CircleAvatar(backgroundColor: Colors.green), leading: const CircleAvatar(backgroundColor: Colors.green),
title: const Text('Green'), title: Text(AppLocalizations.of(context).green),
onTap: () { onTap: () {
context.read<ThemeCubit>().changeTheme(ThemeType.green); context.read<ThemeCubit>().changeTheme(ThemeType.green);
Navigator.pop(context); Navigator.pop(context);
@@ -30,7 +30,7 @@ class ColorThemeDialog extends StatelessWidget {
), ),
ListTile( ListTile(
leading: const CircleAvatar(backgroundColor: Colors.orange), leading: const CircleAvatar(backgroundColor: Colors.orange),
title: const Text('Orange'), title: Text(AppLocalizations.of(context).orange),
onTap: () { onTap: () {
context.read<ThemeCubit>().changeTheme(ThemeType.orange); context.read<ThemeCubit>().changeTheme(ThemeType.orange);
Navigator.pop(context); Navigator.pop(context);

View File

@@ -1,6 +1,6 @@
// ignore_for_file: use_build_context_synchronously
import 'dart:async'; import 'dart:async';
import 'dart:developer';
import 'package:dio/dio.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:kmobile/api/services/imps_service.dart'; import 'package:kmobile/api/services/imps_service.dart';
import 'package:kmobile/api/services/neft_service.dart'; import 'package:kmobile/api/services/neft_service.dart';
@@ -52,7 +52,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() { setState(() {
accountType = AppLocalizations.of(context).savings; accountType = 'Savings';
}); });
}); });
} }
@@ -214,6 +214,29 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
utr: neftResponse.utr, utr: neftResponse.utr,
); );
completer.complete(paymentResponse); 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";
}
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) { } catch (e) {
final paymentResponse = PaymentResponse( final paymentResponse = PaymentResponse(
isSuccess: false, isSuccess: false,
@@ -236,6 +259,9 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
); );
final impsService = getIt<ImpsService>(); final impsService = getIt<ImpsService>();
final completer = Completer<PaymentResponse>(); final completer = Completer<PaymentResponse>();
if (!pinScreenContext.mounted) {
return;
}
Navigator.of(pinScreenContext).pushReplacement( Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute( MaterialPageRoute(
@@ -245,15 +271,29 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
); );
try { try {
final neftResponse = final impsResponse =
await impsService.processImpsTransaction(impsTx); await impsService.processImpsTransaction(impsTx);
final paymentResponse = PaymentResponse( final paymentResponse = PaymentResponse(
isSuccess: neftResponse.message.toUpperCase() == 'SUCCESS', isSuccess: impsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(), date: DateTime.now(),
creditedAccount: impsTx.toAccount, creditedAccount: impsTx.toAccount,
amount: impsTx.amount, amount: impsTx.amount,
currency: 'INR', currency: 'INR',
utr: neftResponse.utr, utr: impsResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
final error = e.response?.data['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); completer.complete(paymentResponse);
} catch (e) { } catch (e) {
@@ -278,7 +318,9 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
); );
final rtgsService = getIt<RtgsService>(); final rtgsService = getIt<RtgsService>();
final completer = Completer<PaymentResponse>(); final completer = Completer<PaymentResponse>();
if (!pinScreenContext.mounted) {
return;
}
Navigator.of(pinScreenContext).pushReplacement( Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute( MaterialPageRoute(
builder: (_) => PaymentAnimationScreen( builder: (_) => PaymentAnimationScreen(
@@ -298,6 +340,22 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
utr: rtgsResponse.utr, utr: rtgsResponse.utr,
); );
completer.complete(paymentResponse); completer.complete(paymentResponse);
} on DioException catch (e) {
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"
}[error] ??
"Something Went Wrong";
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) { } catch (e) {
final paymentResponse = PaymentResponse( final paymentResponse = PaymentResponse(
isSuccess: false, isSuccess: false,
@@ -434,6 +492,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
), ),
const SizedBox(height: 25), const SizedBox(height: 25),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: TextFormField( child: TextFormField(
@@ -482,7 +541,9 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
}, },
), ),
), ),
const SizedBox(width: 10), const SizedBox(
width: 10,
),
Expanded( Expanded(
child: DropdownButtonFormField<String>( child: DropdownButtonFormField<String>(
value: accountType, value: accountType,
@@ -500,8 +561,8 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
), ),
), ),
items: [ items: [
AppLocalizations.of(context).savings, 'Savings',
AppLocalizations.of(context).current, 'Current',
] ]
.map( .map(
(e) => DropdownMenuItem(value: e, child: Text(e)), (e) => DropdownMenuItem(value: e, child: Text(e)),

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; 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_outside_bank_screen.dart';
import 'package:kmobile/features/quick_pay/screens/quick_pay_within_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'; import 'package:material_symbols_icons/material_symbols_icons.dart';
@@ -18,33 +17,9 @@ class _QuickPayScreen extends State<QuickPayScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: const Icon(Symbols.arrow_back_ios_new),
onPressed: () {
Navigator.pop(context);
},
),
title: Text( title: Text(
AppLocalizations.of(context).quickPay.replaceAll('\n', ' '), AppLocalizations.of(context).quickPay.replaceAll('\n', ''),
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( body: ListView(
children: [ children: [

View File

@@ -25,10 +25,10 @@
"hi": "Hi", "hi": "Hi",
"kMobile": "kMobile", "kMobile": "kMobile",
"scanBiometric": "Scan to enable Biometric login", "scanBiometric": "Scan to enable Biometric login",
"savingsAccount": "Savings Account", "savingsAccount": "Savings",
"loanAccount": "Loan Account", "loanAccount": "Loan",
"termDeposit": "Term Deposit Account", "termDeposit": "Term Deposit",
"recurringDeposit": "Recurring Deposit Account", "recurringDeposit": "Recurring Deposit",
"unknownAccount": "Unknown Account Type", "unknownAccount": "Unknown Account Type",
"customerInfo": "Customer \n Info", "customerInfo": "Customer \n Info",
"fundTransfer": "Fund \n Transfer", "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.", "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", "correctTpin": "Please Enter the correct TPIN",
"insufficientFund": "Your account does not have sufficient balance", "insufficientFund": "Your account does not have sufficient balance",
"creditedTo": "Credited To", "creditedTo": "Credit To",
"selectTransactionType": "Select transaction Type", "selectTransactionType": "Select transaction Type",
"proceed": "Proceed", "proceed": "Proceed",
"plsValidateBeneficiary": "Please validate beneficiary details first", "plsValidateBeneficiary": "Please validate beneficiary details first",
@@ -250,6 +250,45 @@
"findnearbybranched": "Find nearby branches", "findnearbybranched": "Find nearby branches",
"searchbranch": "Search Branch", "searchbranch": "Search Branch",
"searchbranchby": "Search by Branch Name / Code / IFSC", "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 चुनें", "invalidRtgsPopUp": "RTGS लेनदेन के लिए न्यूनतम 2,00,000 रुपये की राशि की आवश्यकता होती है। कृपया अधिक राशि दर्ज करें या लेनदेन मोड के रूप में NEFT चुनें",
"correctTpin": "कृपया सही टी-पिन दर्ज करें", "correctTpin": "कृपया सही टी-पिन दर्ज करें",
"insufficientFund": "आपके खाते में पर्याप्त शेष राशि नहीं है", "insufficientFund": "आपके खाते में पर्याप्त शेष राशि नहीं है",
"creditedTo": "को श्रेय दिया गया", "creditedTo": "को श्रेय",
"selectTransactionType": "लेन-देन का प्रकार चुनें", "selectTransactionType": "लेन-देन का प्रकार चुनें",
"proceed": "आगे बढ़ना", "proceed": "आगे बढ़ना",
"plsValidateBeneficiary": "कृपया पहले लाभार्थी विवरण सत्यापित करें", "plsValidateBeneficiary": "कृपया पहले लाभार्थी विवरण सत्यापित करें",
@@ -250,5 +250,45 @@
"findnearbybranched": "आस-पास की शाखाएँ खोजें", "findnearbybranched": "आस-पास की शाखाएँ खोजें",
"searchbranch": "शाखा खोजें", "searchbranch": "शाखा खोजें",
"searchbranchby": "शाखा खोजें नाम / बैंक कोड / आईएफएससी द्वारा", "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/material.dart';
import 'package:flutter/services.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 'di/injection.dart';
import 'app.dart'; import 'app.dart';
@@ -14,5 +16,17 @@ void main() async {
// Initialize dependencies // Initialize dependencies
await setupDependencies(); 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()); 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')) { if (bankName != null && bankName.toLowerCase().contains('kangra central')) {
return Image.asset( return Image.asset(
'assets/images/icon.png', 'assets/images/logo.png',
width: 40, width: 40,
height: 40, height: 40,
); );

View File

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

View File

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