Compare commits
45 Commits
351ee84414
...
sim-bindin
Author | SHA1 | Date | |
---|---|---|---|
f9fd74ea53 | |||
852f708633 | |||
de596aa138 | |||
720c6ec03a | |||
d081a5433c | |||
90f4a6bb81 | |||
|
f71c8d646b | ||
|
6a8f091ac5 | ||
|
596f0a96eb | ||
|
768d312066 | ||
|
4277ca9169 | ||
|
53caa5b7ae | ||
|
bfa0721e79 | ||
|
75bcce8201 | ||
|
99f4b1b735 | ||
|
6ebc96d153 | ||
|
6496aa95c0 | ||
|
e91efafa0e | ||
|
61a6e356d9 | ||
|
a48781ad1b | ||
|
d425af184e | ||
|
bc2c460f96 | ||
|
ef3556f207 | ||
|
6724d8bed0 | ||
|
83ed973b44 | ||
|
f7dd31fb93 | ||
|
9c60dc1c1c | ||
|
c369ad415d | ||
|
f934f0bff6 | ||
|
da0287ef38 | ||
|
f65507a706 | ||
9f6b35d3eb | |||
a33b4bc1e1 | |||
0d629226a8 | |||
6d502a0c81 | |||
96d1e37c42 | |||
b0610ad84d | |||
ceb29ee7fe | |||
57cb93c124 | |||
0ac9a1f319 | |||
d3ad68b25c | |||
|
eb0e1c120e | ||
a64e68d642 | |||
80faa06272 | |||
0bab68a2e6 |
@@ -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
77
android/app/proguard-rules.pro
vendored
Normal 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 *;
|
||||||
|
}
|
@@ -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';
|
||||||
|
|
||||||
|
@@ -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()}');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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()}');
|
||||||
|
@@ -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) {}
|
|
||||||
}
|
}
|
||||||
|
47
lib/app.dart
47
lib/app.dart
@@ -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 {
|
||||||
|
@@ -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';
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
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) {
|
||||||
@@ -27,7 +28,8 @@ class AppThemes {
|
|||||||
return ThemeData.from(
|
return ThemeData.from(
|
||||||
colorScheme: colorScheme,
|
colorScheme: colorScheme,
|
||||||
useMaterial3: true, // Recommended for modern Flutter apps
|
useMaterial3: true, // Recommended for modern Flutter apps
|
||||||
).copyWith(
|
textTheme: GoogleFonts.rubikTextTheme())
|
||||||
|
.copyWith(
|
||||||
scaffoldBackgroundColor: Colors.white,
|
scaffoldBackgroundColor: Colors.white,
|
||||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||||
backgroundColor: colorScheme.surface,
|
backgroundColor: colorScheme.surface,
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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,36 +30,10 @@ 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),
|
||||||
children: [
|
children: [
|
||||||
@@ -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),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@@ -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,12 +163,19 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
// Text(
|
Row(
|
||||||
// AppLocalizations.of(context).availableBalance,
|
children: [
|
||||||
// style: const TextStyle(fontSize: 17),
|
Text(
|
||||||
// ),
|
"${AppLocalizations.of(context).availableBalance}: ",
|
||||||
// const SizedBox(height: 15),
|
style: const TextStyle(
|
||||||
// Text(widget.accountNo, style: const TextStyle(fontSize: 17)),
|
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),
|
||||||
@@ -202,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,
|
||||||
|
@@ -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),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -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));
|
||||||
|
@@ -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> {
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
// Automatically go to logizn after 4 seconds
|
|
||||||
Timer(const Duration(seconds: 4), () {
|
|
||||||
widget.onContinue();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _SplashScreenState extends State<SplashScreen> {
|
||||||
@override
|
@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,
|
@@ -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;
|
||||||
|
if (ifsc.toLowerCase().contains('kace')) {
|
||||||
|
beneficiaryName =
|
||||||
|
await service.validateBeneficiaryWithinBank(accountNo);
|
||||||
|
} else {
|
||||||
|
beneficiaryName = await service.validateBeneficiary(
|
||||||
accountNo: accountNo,
|
accountNo: accountNo,
|
||||||
ifscCode: ifsc,
|
ifscCode: ifsc,
|
||||||
remitterName: remitter,
|
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(
|
||||||
|
@@ -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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -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),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
164
lib/features/card/screens/card_details_screen.dart
Normal file
164
lib/features/card/screens/card_details_screen.dart
Normal 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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -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;
|
||||||
|
@@ -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),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@@ -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: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
isVisible
|
isVisible
|
||||||
? Symbols.visibility_lock
|
? Symbols.visibility_lock
|
||||||
: Symbols.visibility,
|
: Symbols.visibility,
|
||||||
color: Theme.of(context)
|
color: theme.scaffoldBackgroundColor,
|
||||||
.scaffoldBackgroundColor,
|
weight: 800,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -492,8 +486,7 @@ 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!,
|
||||||
@@ -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,8 +563,9 @@ 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 ?? '',
|
||||||
@@ -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(
|
||||||
|
@@ -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
|
||||||
@@ -50,7 +52,35 @@ 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,
|
||||||
|
);
|
||||||
|
|
||||||
|
final paymentService = getIt<PaymentService>();
|
||||||
|
final paymentResponseFuture =
|
||||||
|
paymentService.processQuickPayWithinBank(transfer);
|
||||||
|
|
||||||
|
Navigator.of(pinScreenContext).pushReplacement(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => PaymentAnimationScreen(
|
||||||
|
paymentResponse: paymentResponseFuture),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
if (_selectedMode == TransactionMode.rtgs && amount < 200000) {
|
if (_selectedMode == TransactionMode.rtgs && amount < 200000) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -84,7 +114,6 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
tpin: tpin,
|
tpin: tpin,
|
||||||
);
|
);
|
||||||
final neftService = getIt<NeftService>();
|
final neftService = getIt<NeftService>();
|
||||||
|
|
||||||
final completer = Completer<PaymentResponse>();
|
final completer = Completer<PaymentResponse>();
|
||||||
|
|
||||||
Navigator.of(pinScreenContext).pushReplacement(
|
Navigator.of(pinScreenContext).pushReplacement(
|
||||||
@@ -98,7 +127,8 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
final neftResponse =
|
final neftResponse =
|
||||||
await neftService.processNeftTransaction(neftTx);
|
await neftService.processNeftTransaction(neftTx);
|
||||||
final paymentResponse = PaymentResponse(
|
final paymentResponse = PaymentResponse(
|
||||||
isSuccess: neftResponse.message.toUpperCase() == 'SUCCESS',
|
isSuccess:
|
||||||
|
neftResponse.message.toUpperCase() == 'SUCCESS',
|
||||||
date: DateTime.now(),
|
date: DateTime.now(),
|
||||||
creditedAccount: neftTx.toAccount,
|
creditedAccount: neftTx.toAccount,
|
||||||
amount: neftTx.amount,
|
amount: neftTx.amount,
|
||||||
@@ -107,35 +137,38 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
print('dio exception');
|
String errorMessage;
|
||||||
print(e.toString());
|
if (e.response != null && e.response!.data != null) {
|
||||||
|
try {
|
||||||
final error = jsonDecode(e.response.toString())['error'];
|
// final error = jsonDecode(e.response!.toString())['error'];
|
||||||
var errorMessage = {
|
final error = e.response?.data['error'];
|
||||||
"INCORRECT_TPIN":
|
errorMessage = {
|
||||||
AppLocalizations.of(context).correctTpin,
|
"INCORRECT_TPIN": "Please Enter the correct TPIN",
|
||||||
"INSUFFICIENT_FUNDS":
|
"INSUFFICIENT_FUNDS":
|
||||||
AppLocalizations.of(context).insufficientFund
|
"Your account does not have sufficient balance"
|
||||||
}[error] ??
|
}[error] ??
|
||||||
AppLocalizations.of(context).somethingWentWrong;
|
"Something Went Wrong";
|
||||||
|
} catch (_) {
|
||||||
|
errorMessage = "Something Went Wrong";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
errorMessage = "Something Went Wrong";
|
||||||
|
}
|
||||||
final paymentResponse = PaymentResponse(
|
final paymentResponse = PaymentResponse(
|
||||||
isSuccess: false,
|
isSuccess: false,
|
||||||
errorMessage: errorMessage,
|
errorMessage: errorMessage,
|
||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('generic exception');
|
if (!pinScreenContext.mounted) return;
|
||||||
print(e.toString());
|
|
||||||
final paymentResponse = PaymentResponse(
|
final paymentResponse = PaymentResponse(
|
||||||
isSuccess: false,
|
isSuccess: false,
|
||||||
errorMessage:
|
errorMessage: AppLocalizations.of(pinScreenContext)
|
||||||
AppLocalizations.of(context).somethingWentWrong,
|
.somethingWentWrong,
|
||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//IMPS transaction
|
//IMPS transaction
|
||||||
else if (_selectedMode == TransactionMode.imps) {
|
else if (_selectedMode == TransactionMode.imps) {
|
||||||
final impsTx = ImpsTransaction(
|
final impsTx = ImpsTransaction(
|
||||||
@@ -161,7 +194,8 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
final impsResponse =
|
final impsResponse =
|
||||||
await impsService.processImpsTransaction(impsTx);
|
await impsService.processImpsTransaction(impsTx);
|
||||||
final paymentResponse = PaymentResponse(
|
final paymentResponse = PaymentResponse(
|
||||||
isSuccess: impsResponse.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,
|
||||||
@@ -170,9 +204,6 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
print('dio exception');
|
|
||||||
print(e.toString());
|
|
||||||
|
|
||||||
final error = jsonDecode(e.response.toString())['error'];
|
final error = jsonDecode(e.response.toString())['error'];
|
||||||
var errorMessage = {
|
var errorMessage = {
|
||||||
"INCORRECT_TPIN": "Please Enter the correct TPIN",
|
"INCORRECT_TPIN": "Please Enter the correct TPIN",
|
||||||
@@ -187,15 +218,15 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('generic exception');
|
|
||||||
print(e.toString());
|
|
||||||
final paymentResponse = PaymentResponse(
|
final paymentResponse = PaymentResponse(
|
||||||
isSuccess: false,
|
isSuccess: false,
|
||||||
errorMessage: "Something went Wrong",
|
errorMessage: "Something went Wrong",
|
||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
//RTGS
|
||||||
|
else {
|
||||||
final rtgsTx = RtgsTransaction(
|
final rtgsTx = RtgsTransaction(
|
||||||
fromAccount: widget.debitAccountNo,
|
fromAccount: widget.debitAccountNo,
|
||||||
toAccount: widget.creditBeneficiary.accountNo,
|
toAccount: widget.creditBeneficiary.accountNo,
|
||||||
@@ -219,7 +250,8 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
final rtgsResponse =
|
final rtgsResponse =
|
||||||
await rtgsService.processRtgsTransaction(rtgsTx);
|
await rtgsService.processRtgsTransaction(rtgsTx);
|
||||||
final paymentResponse = PaymentResponse(
|
final paymentResponse = PaymentResponse(
|
||||||
isSuccess: rtgsResponse.message.toUpperCase() == 'SUCCESS',
|
isSuccess:
|
||||||
|
rtgsResponse.message.toUpperCase() == 'SUCCESS',
|
||||||
date: DateTime.now(),
|
date: DateTime.now(),
|
||||||
creditedAccount: rtgsTx.toAccount,
|
creditedAccount: rtgsTx.toAccount,
|
||||||
amount: rtgsTx.amount,
|
amount: rtgsTx.amount,
|
||||||
@@ -228,18 +260,14 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
print('dio exception');
|
|
||||||
print(e.toString());
|
|
||||||
|
|
||||||
final error = jsonDecode(e.response.toString())['error'];
|
final error = jsonDecode(e.response.toString())['error'];
|
||||||
var errorMessage = {
|
var errorMessage = {
|
||||||
"INCORRECT_TPIN":
|
"INCORRECT_TPIN": "Please Enter the correct TPIN",
|
||||||
AppLocalizations.of(context).correctTpin,
|
|
||||||
"INSUFFICIENT_FUNDS":
|
"INSUFFICIENT_FUNDS":
|
||||||
AppLocalizations.of(context).insufficientFund
|
"Your account does not have sufficient balance"
|
||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
}[error] ??
|
}[error] ??
|
||||||
AppLocalizations.of(context).somethingWentWrong;
|
"Something Went Wrong";
|
||||||
|
|
||||||
final paymentResponse = PaymentResponse(
|
final paymentResponse = PaymentResponse(
|
||||||
isSuccess: false,
|
isSuccess: false,
|
||||||
@@ -247,12 +275,9 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('generic exception');
|
|
||||||
print(e.toString());
|
|
||||||
final paymentResponse = PaymentResponse(
|
final paymentResponse = PaymentResponse(
|
||||||
isSuccess: false,
|
isSuccess: false,
|
||||||
errorMessage:
|
errorMessage: "Something Went Wrong",
|
||||||
AppLocalizations.of(context).somethingWentWrong,
|
|
||||||
);
|
);
|
||||||
completer.complete(paymentResponse);
|
completer.complete(paymentResponse);
|
||||||
}
|
}
|
||||||
@@ -263,6 +288,7 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -314,6 +340,7 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
|
|
||||||
|
if (!widget.isOwnBank) ...[
|
||||||
// Transaction Mode Selection
|
// Transaction Mode Selection
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context).selectTransactionType,
|
AppLocalizations.of(context).selectTransactionType,
|
||||||
@@ -343,9 +370,10 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
color: Theme.of(context).colorScheme.onSurface,
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
borderColor: Colors.transparent,
|
borderColor: Colors.transparent,
|
||||||
selectedBorderColor: Colors.transparent,
|
selectedBorderColor: Colors.transparent,
|
||||||
splashColor: Theme.of(context).primaryColor.withOpacity(0.1),
|
splashColor:
|
||||||
|
Theme.of(context).primaryColor,
|
||||||
highlightColor:
|
highlightColor:
|
||||||
Theme.of(context).primaryColor.withOpacity(0.05),
|
Theme.of(context).primaryColor,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -366,7 +394,7 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
|
],
|
||||||
// Amount
|
// Amount
|
||||||
TextFormField(
|
TextFormField(
|
||||||
controller: _amountController,
|
controller: _amountController,
|
||||||
|
@@ -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,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@@ -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: () {
|
body: ListView(
|
||||||
Navigator.pop(context);
|
children: [
|
||||||
|
FundTransferManagementTile(
|
||||||
|
icon: Symbols.input_circle,
|
||||||
|
label: AppLocalizations.of(context).ownBank,
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => FundTransferBeneficiaryScreen(
|
||||||
|
creditAccountNo: creditAccountNo,
|
||||||
|
remitterName: remitterName,
|
||||||
|
isOwnBank: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
title: Text(
|
const Divider(height: 1),
|
||||||
AppLocalizations.of(context).fundTransfer,
|
FundTransferManagementTile(
|
||||||
style:
|
icon: Symbols.output_circle,
|
||||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
label: AppLocalizations.of(context).outsideBank,
|
||||||
),
|
onTap: () {
|
||||||
centerTitle: false,
|
Navigator.push(
|
||||||
actions: const [
|
context,
|
||||||
Padding(
|
MaterialPageRoute(
|
||||||
padding: EdgeInsets.only(right: 10.0),
|
builder: (context) => FundTransferBeneficiaryScreen(
|
||||||
child: CircleAvatar(
|
creditAccountNo: creditAccountNo,
|
||||||
backgroundImage: AssetImage('assets/images/avatar.jpg'),
|
remitterName: remitterName,
|
||||||
// Replace with your image
|
isOwnBank: false,
|
||||||
radius: 20,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
);
|
||||||
),
|
},
|
||||||
body: Column(
|
|
||||||
children: [
|
|
||||||
const Spacer(),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(AppLocalizations.of(context).debitFrom),
|
|
||||||
const Text(
|
|
||||||
'0300015678903456',
|
|
||||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Text(
|
|
||||||
AppLocalizations.of(context).enterAmount,
|
|
||||||
style: const TextStyle(fontSize: 20),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.grey.shade200,
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
amount.isEmpty ? "0" : amount,
|
|
||||||
style: const TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
color: Theme.of(context).scaffoldBackgroundColor,
|
|
||||||
child: GridView.count(
|
|
||||||
crossAxisCount: 3,
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
mainAxisSpacing: 12,
|
|
||||||
crossAxisSpacing: 12,
|
|
||||||
childAspectRatio: 1.2,
|
|
||||||
children: keys.map((key) => buildKey(key)).toList(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
const Divider(height: 1),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -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);
|
||||||
|
@@ -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)),
|
||||||
|
@@ -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: [
|
||||||
|
@@ -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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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": "कार्ड विवरण देखें"
|
||||||
}
|
}
|
||||||
|
@@ -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
56
lib/rooted_screen.dart
Normal 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"),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -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,
|
||||||
);
|
);
|
||||||
|
@@ -357,6 +357,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.19.0"
|
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:
|
||||||
|
@@ -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"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user