1 Commits

Author SHA1 Message Date
e5a2d0d1f1 Localization Chamges #2 2025-08-19 11:18:25 +05:30
71 changed files with 4629 additions and 2936 deletions

3
.gitignore vendored
View File

@@ -41,6 +41,3 @@ app.*.map.json
/android/app/debug /android/app/debug
/android/app/profile /android/app/profile
/android/app/release /android/app/release
lib/l10n/app_localizations.dart
lib/l10n/app_localizations_en.dart
lib/l10n/app_localizations_hi.dart

View File

@@ -7,9 +7,6 @@
# The following line activates a set of recommended lints for Flutter apps, # The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices. # packages, and plugins designed to encourage good coding practices.
analyzer:
errors:
dead_code: ignore
include: package:flutter_lints/flutter.yaml include: package:flutter_lints/flutter.yaml
linter: linter:

View File

@@ -25,7 +25,7 @@ if (flutterVersionName == null) {
android { android {
namespace "com.example.kmobile" namespace "com.example.kmobile"
compileSdk flutter.compileSdkVersion compileSdk flutter.compileSdkVersion
ndkVersion "27.0.12077973" ndkVersion flutter.ndkVersion
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
@@ -45,7 +45,7 @@ android {
applicationId "com.example.kmobile" applicationId "com.example.kmobile"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 29 minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
@@ -56,10 +56,6 @@ android {
// 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 signingConfig signingConfigs.debug
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
} }

View File

@@ -1,21 +0,0 @@
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.embedding.** { *; }
-keep class io.flutter.embedding.engine.plugins.** { *; }
-keep class com.google.firebase.** { *; }
-keep class com.google.android.gms.** { *; }
# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn com.google.android.play.core.splitcompat.SplitCompatApplication
-dontwarn com.google.android.play.core.splitinstall.SplitInstallException
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManager
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManagerFactory
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest$Builder
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest
-dontwarn com.google.android.play.core.splitinstall.SplitInstallSessionState
-dontwarn com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener
-dontwarn com.google.android.play.core.tasks.OnFailureListener
-dontwarn com.google.android.play.core.tasks.OnSuccessListener
-dontwarn com.google.android.play.core.tasks.Task

View File

@@ -6,7 +6,6 @@
android:label="kmobile" android:label="kmobile"
android:name="${applicationName}" android:name="${applicationName}"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -1,5 +1,3 @@
// ignore_for_file: unused_local_variable
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import '../../data/repositories/auth_repository.dart'; import '../../data/repositories/auth_repository.dart';

View File

@@ -1,4 +1,5 @@
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';
@@ -101,21 +102,8 @@ class BeneficiaryService {
throw Exception("Failed to fetch beneficiaries"); throw Exception("Failed to fetch beneficiaries");
} }
} catch (e) { } catch (e) {
print("Error fetching beneficiaries: $e");
return []; return [];
} }
} }
Future<void> deleteBeneficiary(String accountNo) async {
try {
final response = await _dio.delete('/api/beneficiary/$accountNo');
if (response.statusCode != 204) {
throw Exception('Failed to delete beneficiary');
}
} on DioException catch (e) {
throw Exception('Network error: ${e.message}');
} catch (e) {
throw Exception('Unexpected error: ${e.toString()}');
}
}
} }

View File

@@ -12,7 +12,7 @@ class ImpsService {
try { try {
await Future.delayed(const Duration(seconds: 3)); await Future.delayed(const Duration(seconds: 3));
final response = await _dio.post( final response = await _dio.post(
'/api/payment/imps', '/api/payment/rtgs',
data: transaction.toJson(), data: transaction.toJson(),
); );
@@ -20,7 +20,7 @@ class ImpsService {
return ImpsResponse.fromJson(response.data); return ImpsResponse.fromJson(response.data);
} else { } else {
throw Exception( throw Exception(
'IMPS transaction failed with status code: ${response.statusCode}'); 'RTGS transaction failed with status code: ${response.statusCode}');
} }
} on DioException { } on DioException {
rethrow; rethrow;
@@ -29,3 +29,5 @@ class ImpsService {
} }
} }
} }

View File

@@ -1,5 +1,3 @@
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';
@@ -25,7 +23,6 @@ class NeftService {
'NEFT transaction failed with status code: ${response.statusCode}'); 'NEFT transaction failed with status code: ${response.statusCode}');
} }
} on DioException { } on DioException {
log('DioException Occured');
rethrow; rethrow;
} catch (e) { } catch (e) {
throw Exception('An unexpected error occurred: ${e.toString()}'); throw Exception('An unexpected error occurred: ${e.toString()}');

View File

@@ -38,3 +38,4 @@ class PaymentService {
} }
} }
} }

View File

@@ -2,8 +2,6 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:kmobile/features/auth/controllers/theme_mode_cubit.dart';
import 'package:kmobile/features/auth/controllers/theme_mode_state.dart';
import 'package:kmobile/security/secure_storage.dart'; import 'package:kmobile/security/secure_storage.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import './l10n/app_localizations.dart'; import './l10n/app_localizations.dart';
@@ -13,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/splash_screen.dart'; import 'features/auth/screens/welcome_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';
@@ -42,7 +40,7 @@ class _KMobileState extends State<KMobile> {
void initState() { void initState() {
super.initState(); super.initState();
loadPreferences(); loadPreferences();
Future.delayed(const Duration(seconds: 3), () { Future.delayed(const Duration(seconds: 2), () {
setState(() { setState(() {
showSplash = false; showSplash = false;
}); });
@@ -69,6 +67,7 @@ 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,
@@ -80,34 +79,30 @@ class _KMobileState extends State<KMobile> {
providers: [ providers: [
BlocProvider<AuthCubit>(create: (_) => getIt<AuthCubit>()), BlocProvider<AuthCubit>(create: (_) => getIt<AuthCubit>()),
BlocProvider<ThemeCubit>(create: (_) => ThemeCubit()), BlocProvider<ThemeCubit>(create: (_) => ThemeCubit()),
BlocProvider<ThemeModeCubit>(create: (_) => ThemeModeCubit()),
], ],
child: BlocBuilder<ThemeCubit, ThemeState>( child: BlocBuilder<ThemeCubit, ThemeState>(
builder: (context, themeState) { builder: (context, themeState) {
return BlocBuilder<ThemeModeCubit, ThemeModeState>( print('global theme state changed');
builder: (context, modeState) { return MaterialApp(
return MaterialApp( debugShowCheckedModeBanner: false,
debugShowCheckedModeBanner: false, locale: _locale ?? const Locale('en'),
locale: _locale ?? const Locale('en'), supportedLocales: const [
supportedLocales: const [ Locale('en'),
Locale('en'), Locale('hi'),
Locale('hi'), ],
], localizationsDelegates: const [
localizationsDelegates: const [ AppLocalizations.delegate,
AppLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, ],
], title: 'kMobile',
title: 'kMobile', theme: themeState.getThemeData(),
theme: themeState.getLightThemeData(), darkTheme: themeState.getThemeData(),
darkTheme: themeState.getDarkThemeData(), themeMode: ThemeMode.system,
themeMode: context.watch<ThemeModeCubit>().state.mode, onGenerateRoute: AppRoutes.generateRoute,
onGenerateRoute: AppRoutes.generateRoute, initialRoute: AppRoutes.splash,
initialRoute: AppRoutes.splash, home: showSplash ? const SplashScreen() : const AuthGate(),
home: showSplash ? const SplashScreen() : const AuthGate(),
);
},
); );
}, },
), ),
@@ -125,6 +120,7 @@ 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;
@@ -157,13 +153,9 @@ class _AuthGateState extends State<AuthGate> {
final localAuth = LocalAuthentication(); final localAuth = LocalAuthentication();
final canCheck = await localAuth.canCheckBiometrics; final canCheck = await localAuth.canCheckBiometrics;
if (!canCheck) return false; if (!canCheck) return false;
String localizedReason = "";
if (mounted) {
localizedReason = AppLocalizations.of(context).authenticateToAccess;
}
try { try {
final didAuth = await localAuth.authenticate( final didAuth = await localAuth.authenticate(
localizedReason: localizedReason, localizedReason: AppLocalizations.of(context).authenticateToAccess,
options: const AuthenticationOptions( options: const AuthenticationOptions(
stickyAuth: true, stickyAuth: true,
biometricOnly: true, biometricOnly: true,
@@ -180,7 +172,18 @@ 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) {
@@ -195,6 +198,7 @@ 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: (_) {
@@ -220,6 +224,7 @@ 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 {
@@ -250,14 +255,11 @@ class _AuthGateState extends State<AuthGate> {
if (optIn == true) { if (optIn == true) {
final canCheck = await localAuth.canCheckBiometrics; final canCheck = await localAuth.canCheckBiometrics;
bool didAuth = false; bool didAuth = false;
String authEnable = "";
if (context.mounted) {
authEnable = AppLocalizations.of(context).authenticateToEnable;
}
if (canCheck) { if (canCheck) {
didAuth = await localAuth.authenticate( didAuth = await localAuth.authenticate(
localizedReason: authEnable, localizedReason:
AppLocalizations.of(context).authenticateToEnable,
options: const AuthenticationOptions( options: const AuthenticationOptions(
stickyAuth: true, stickyAuth: true,
biometricOnly: true, biometricOnly: true,
@@ -270,17 +272,17 @@ class _AuthGateState extends State<AuthGate> {
} }
} }
if (context.mounted) { Navigator.of(context).pushReplacement(
Navigator.of(context).pushReplacement( MaterialPageRoute(
MaterialPageRoute( builder: (_) => const NavigationScaffold(),
builder: (_) => const NavigationScaffold(), ),
), );
);
}
}, },
); );
} }
} }
// ✅ Step 3: If not logged in, show login screen
return const LoginScreen(); return const LoginScreen();
} }
} }
@@ -302,8 +304,17 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
const ServiceScreen(), const ServiceScreen(),
]; ];
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
_pageController.jumpToPage(index);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print(
"--- NavigationScaffold is rebuilding with theme color: ${Theme.of(context).primaryColor}");
return PopScope( return PopScope(
canPop: false, canPop: false,
onPopInvokedWithResult: (didPop, result) async { onPopInvokedWithResult: (didPop, result) async {
@@ -342,10 +353,10 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
currentIndex: _selectedIndex, currentIndex: _selectedIndex,
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context)
selectedItemColor: Theme.of(context).colorScheme.primary, .scaffoldBackgroundColor, // Light blue background
unselectedItemColor: selectedItemColor: Theme.of(context).primaryColor,
Theme.of(context).colorScheme.onSurface.withOpacity(0.7), unselectedItemColor: Colors.black54,
onTap: (index) { onTap: (index) {
setState(() { setState(() {
_selectedIndex = index; _selectedIndex = index;
@@ -372,6 +383,29 @@ 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;
@@ -384,12 +418,8 @@ class BiometricPromptScreen extends StatelessWidget {
onCompleted(); onCompleted();
return; return;
} }
String localizedReason = "";
if (context.mounted) {
localizedReason = AppLocalizations.of(context).enableFingerprintQuick;
}
final didAuth = await localAuth.authenticate( final didAuth = await localAuth.authenticate(
localizedReason: localizedReason, localizedReason: AppLocalizations.of(context).enableFingerprintQuick,
options: const AuthenticationOptions( options: const AuthenticationOptions(
stickyAuth: true, stickyAuth: true,
biometricOnly: true, biometricOnly: true,
@@ -433,9 +463,6 @@ class BiometricPromptScreen extends StatelessWidget {
], ],
), ),
); );
if (!context.mounted) {
return;
}
if (result == true) { if (result == true) {
await _handleBiometric(context); await _handleBiometric(context);
} else { } else {

View File

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

View File

@@ -3,5 +3,4 @@ enum ThemeType {
green, green,
orange, orange,
blue, blue,
yellow,
} }

View File

@@ -1,52 +1,32 @@
import 'dart:developer';
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) {
final Color seedColor = _getSeedColor(type); switch (type) {
final colorScheme = ColorScheme.fromSeed( case ThemeType.green:
seedColor: seedColor, return ThemeData(primarySwatch: Colors.green);
brightness: Brightness.light, case ThemeType.orange:
); return ThemeData(primarySwatch: Colors.orange);
return ThemeData.from( case ThemeType.blue:
colorScheme: colorScheme, return ThemeData(primarySwatch: Colors.blue);
useMaterial3: true, case ThemeType.violet:
textTheme: GoogleFonts.rubikTextTheme(), default:
); return ThemeData(primarySwatch: Colors.deepPurple);
}
} }
static ThemeData getDarkTheme(ThemeType type) { static ThemeData getDarkTheme(ThemeType type) {
final Color seedColor = _getSeedColor(type);
log(seedColor.toString());
final colorScheme = ColorScheme.fromSeed(
seedColor: seedColor,
brightness: Brightness.dark,
);
return ThemeData.from(
colorScheme: colorScheme,
useMaterial3: true,
textTheme: GoogleFonts.rubikTextTheme(
ThemeData(brightness: Brightness.dark).textTheme,
),
);
}
static Color _getSeedColor(ThemeType type) {
switch (type) { switch (type) {
case ThemeType.green: case ThemeType.green:
return Colors.green; return ThemeData.dark().copyWith(primaryColor: Colors.green);
case ThemeType.orange: case ThemeType.orange:
return Colors.orange; return ThemeData.dark().copyWith(primaryColor: Colors.orange);
case ThemeType.blue: case ThemeType.blue:
return Colors.blue; return ThemeData.dark().copyWith(primaryColor: Colors.blue);
case ThemeType.violet: case ThemeType.violet:
return Colors.deepPurple; default:
case ThemeType.yellow: return ThemeData.dark().copyWith(primaryColor: Colors.deepPurple);
return Colors.yellow;
} }
} }
} }

View File

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

View File

@@ -19,12 +19,13 @@ class ImpsTransaction {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
return { return {
'fromAccount': fromAccount, 'stFromAccDetails': fromAccount,
'toAccount': toAccount, 'stBenAccNo': toAccount,
'amount': amount, 'stTransferAmount': amount,
'ifscCode': ifscCode, 'stBenIFSC': ifscCode,
'remitterName': remitterName, //'remitterName': remitterName,
'beneficiaryName': beneficiaryName, 'stBeneName': beneficiaryName,
'stRemarks': "Check",
'tpin': tpin, 'tpin': tpin,
}; };
} }

View File

@@ -49,12 +49,6 @@ class AuthRepository {
_tokenExpiryKey, token.expiresAt.toIso8601String()); _tokenExpiryKey, token.expiresAt.toIso8601String());
} }
Future<void> clearAuthTokens() async {
await _secureStorage.deleteAll();
}
Future<AuthToken?> _getAuthToken() async { Future<AuthToken?> _getAuthToken() async {
final accessToken = await _secureStorage.read(_accessTokenKey); final accessToken = await _secureStorage.read(_accessTokenKey);
final expiryString = await _secureStorage.read(_tokenExpiryKey); final expiryString = await _secureStorage.read(_tokenExpiryKey);

View File

@@ -1,6 +1,5 @@
import 'package:kmobile/api/services/rtgs_service.dart'; import 'package:kmobile/api/services/rtgs_service.dart';
import 'package:kmobile/api/services/neft_service.dart'; import 'package:kmobile/api/services/neft_service.dart';
import 'package:kmobile/api/services/imps_service.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:kmobile/api/services/beneficiary_service.dart'; import 'package:kmobile/api/services/beneficiary_service.dart';
@@ -8,7 +7,6 @@ import 'package:kmobile/api/services/payment_service.dart';
import 'package:kmobile/api/services/user_service.dart'; import 'package:kmobile/api/services/user_service.dart';
import 'package:kmobile/data/repositories/transaction_repository.dart'; import 'package:kmobile/data/repositories/transaction_repository.dart';
import 'package:kmobile/features/auth/controllers/theme_cubit.dart'; import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
import 'package:kmobile/features/auth/controllers/theme_mode_cubit.dart';
import '../api/services/auth_service.dart'; import '../api/services/auth_service.dart';
import '../api/interceptors/auth_interceptor.dart'; import '../api/interceptors/auth_interceptor.dart';
import '../data/repositories/auth_repository.dart'; import '../data/repositories/auth_repository.dart';
@@ -21,7 +19,6 @@ Future<void> setupDependencies() async {
//getIt.registerLazySingleton<ThemeController>(() => ThemeController()); //getIt.registerLazySingleton<ThemeController>(() => ThemeController());
//getIt.registerLazySingleton<ThemeModeController>(() => ThemeModeController()); //getIt.registerLazySingleton<ThemeModeController>(() => ThemeModeController());
getIt.registerSingleton<ThemeCubit>(ThemeCubit()); getIt.registerSingleton<ThemeCubit>(ThemeCubit());
getIt.registerSingleton<ThemeModeCubit>(ThemeModeCubit());
// Register Dio client // Register Dio client
getIt.registerSingleton<Dio>(_createDioClient()); getIt.registerSingleton<Dio>(_createDioClient());
@@ -47,7 +44,6 @@ Future<void> setupDependencies() async {
getIt.registerSingleton<BeneficiaryService>(BeneficiaryService(getIt<Dio>())); getIt.registerSingleton<BeneficiaryService>(BeneficiaryService(getIt<Dio>()));
getIt.registerSingleton<NeftService>(NeftService(getIt<Dio>())); getIt.registerSingleton<NeftService>(NeftService(getIt<Dio>()));
getIt.registerSingleton<RtgsService>(RtgsService(getIt<Dio>())); getIt.registerSingleton<RtgsService>(RtgsService(getIt<Dio>()));
getIt.registerSingleton<ImpsService>(ImpsService(getIt<Dio>()));
// Add auth interceptor after repository is available // Add auth interceptor after repository is available
getIt<Dio>().interceptors.add( getIt<Dio>().interceptors.add(

View File

@@ -1,5 +1,7 @@
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 {
@@ -30,9 +32,35 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
int selectedIndex = widget.selectedIndex; int selectedIndex = widget.selectedIndex;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context) leading: IconButton(
.accountInfo icon: const Icon(Symbols.arrow_back_ios_new),
.replaceFirst(RegExp('\n'), '')), onPressed: () {
Navigator.pop(context);
},
),
title: Text(
AppLocalizations.of(context).accountInfo,
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
centerTitle: false,
actions: [
Padding(
padding: const EdgeInsets.only(right: 10.0),
child: CircleAvatar(
backgroundColor: Colors.grey[200],
radius: 20,
child: SvgPicture.asset(
'assets/images/avatar_male.svg',
width: 40,
height: 40,
fit: BoxFit.cover,
),
),
),
],
), ),
body: ListView( body: ListView(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
@@ -42,6 +70,7 @@ 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) {
@@ -101,7 +130,6 @@ 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),
@@ -110,16 +138,16 @@ class InfoRow extends StatelessWidget {
children: [ children: [
Text( Text(
title, title,
style: TextStyle( style: const TextStyle(
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: theme.colorScheme.onSurfaceVariant, color: Colors.black87,
), ),
), ),
const SizedBox(height: 3), const SizedBox(height: 3),
Text( Text(
value, value,
style: TextStyle(fontSize: 16, color: theme.colorScheme.onSurface), style: const TextStyle(fontSize: 16, color: Colors.black),
), ),
], ],
), ),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart'; import 'package:material_symbols_icons/material_symbols_icons.dart';
import 'package:shimmer/shimmer.dart'; import 'package:shimmer/shimmer.dart';
import 'package:kmobile/data/models/transaction.dart'; import 'package:kmobile/data/models/transaction.dart';
@@ -9,12 +10,7 @@ import 'transaction_details_screen.dart';
class AccountStatementScreen extends StatefulWidget { class AccountStatementScreen extends StatefulWidget {
final String accountNo; final String accountNo;
final String balance; const AccountStatementScreen({super.key, required this.accountNo});
const AccountStatementScreen({
super.key,
required this.accountNo,
required this.balance,
});
@override @override
State<AccountStatementScreen> createState() => _AccountStatementScreen(); State<AccountStatementScreen> createState() => _AccountStatementScreen();
@@ -118,10 +114,31 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
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).accountStatement, AppLocalizations.of(context).accountStatement,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, 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: Padding( body: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
@@ -133,7 +150,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
Text( Text(
"${AppLocalizations.of(context).accountNumber}: ", "${AppLocalizations.of(context).accountNumber}: ",
style: const TextStyle( style: const TextStyle(
fontSize: 17, fontSize: 19,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
@@ -141,19 +158,6 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
], ],
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
Row(
children: [
Text(
"${AppLocalizations.of(context).availableBalance}: ",
style: const TextStyle(
fontSize: 17,
),
),
Text('${widget.balance}',
style: const TextStyle(fontSize: 17)),
],
),
const SizedBox(height: 15),
Text( Text(
AppLocalizations.of(context).filters, AppLocalizations.of(context).filters,
style: const TextStyle(fontSize: 17), style: const TextStyle(fontSize: 17),
@@ -188,20 +192,19 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
child: ElevatedButton( child: ElevatedButton(
onPressed: _loadTransactions, onPressed: _loadTransactions,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor: Theme.of(context).primaryColor,
Theme.of(context).colorScheme.primaryContainer,
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),
), ),
child: Text( child: Text(
AppLocalizations.of(context).search, "Search",
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.onPrimaryContainer, color: Theme.of(context).scaffoldBackgroundColor,
fontSize: 16, fontSize: 16,
), ),
), ),
), ),
), ),
const SizedBox(height: 15), const SizedBox(height: 35),
if (!_txLoading && if (!_txLoading &&
_transactions.isNotEmpty && _transactions.isNotEmpty &&
fromDate == null && fromDate == null &&
@@ -213,7 +216,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant, color: Colors.grey[700],
), ),
), ),
), ),
@@ -254,13 +257,12 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
: _transactions.isEmpty : _transactions.isEmpty
? Center( ? Center(
child: Text( child: Text(
AppLocalizations.of(context).noTransactions, AppLocalizations.of(context).noTransactions,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16, color: Colors.grey[600]),
color: Theme.of(context).colorScheme.onSurface, ),
)),
) )
: ListView.separated( : ListView.builder(
itemCount: _transactions.length, itemCount: _transactions.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final tx = _transactions[index]; final tx = _transactions[index];
@@ -269,25 +271,24 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
tx.type == 'CR' tx.type == 'CR'
? Symbols.call_received ? Symbols.call_received
: Symbols.call_made, : Symbols.call_made,
color: tx.type == 'CR' color:
? Colors.green tx.type == 'CR' ? Colors.green : Colors.red,
: Theme.of(context).colorScheme.error,
), ),
title: Text( title: Text(
tx.date ?? '',
style: const TextStyle(fontSize: 15),
),
subtitle: Text(
tx.name != null tx.name != null
? (tx.name!.length > 18 ? (tx.name!.length > 18
? tx.name!.substring(0, 22) ? tx.name!.substring(0, 22)
: tx.name!) : tx.name!)
: '', : '',
style: const TextStyle(fontSize: 14),
),
subtitle: Text(
tx.date ?? '',
style: const TextStyle(fontSize: 12), style: const TextStyle(fontSize: 12),
), ),
trailing: Text( trailing: Text(
"${tx.amount}", "${tx.amount}",
style: const TextStyle(fontSize: 17), style: const TextStyle(fontSize: 16),
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@@ -300,9 +301,6 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
}, },
); );
}, },
separatorBuilder: (context, index) {
return const Divider();
},
), ),
), ),
], ],
@@ -315,8 +313,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16), padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
decoration: BoxDecoration( decoration: BoxDecoration(
border: border: Border.all(color: Colors.grey),
Border.all(color: Theme.of(context).colorScheme.onSurfaceVariant),
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
child: Row( child: Row(
@@ -326,9 +323,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
date != null ? _formatDate(date) : label, date != null ? _formatDate(date) : label,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: date != null color: date != null ? Colors.black : Colors.grey,
? Theme.of(context).colorScheme.onSurface
: Theme.of(context).colorScheme.onSurfaceVariant,
), ),
), ),
const Icon(Icons.arrow_drop_down), const Icon(Icons.arrow_drop_down),

View File

@@ -11,6 +11,33 @@ class TransactionDetailsScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final bool isCredit = transaction.type?.toUpperCase() == 'CR'; final bool isCredit = transaction.type?.toUpperCase() == 'CR';
// Future<void> _shareScreenshot() async {
// try {
// RenderRepaintBoundary boundary =
// _shareKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
// ui.Image image = await boundary.toImage(pixelRatio: 3.0);
// ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);
// Uint8List pngBytes = byteData!.buffer.asUint8List();
// final tempDir = await getTemporaryDirectory();
// final file = await File('${tempDir.path}/payment_result.png').create();
// await file.writeAsBytes(pngBytes);
// await Share.shareXFiles(
// [XFile(file.path)],
// text: AppLocalizations.of(context).paymentResult,
// );
// } catch (e) {
// if (!mounted) return;
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text(
// '${AppLocalizations.of(context).failedToShareScreenshot}: $e',
// ),
// ),
// );
// }
// }
return Scaffold( return Scaffold(
appBar: appBar:
AppBar(title: Text(AppLocalizations.of(context).transactionDetails)), AppBar(title: Text(AppLocalizations.of(context).transactionDetails)),
@@ -18,6 +45,7 @@ class TransactionDetailsScreen extends StatelessWidget {
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Column( child: Column(
children: [ children: [
// Absolute center for amount + icon + date + details
Expanded( Expanded(
flex: 3, flex: 3,
child: Center( child: Center(
@@ -57,12 +85,17 @@ class TransactionDetailsScreen extends StatelessWidget {
), ),
), ),
), ),
const Divider(), const Divider(),
// All details
Expanded( Expanded(
flex: 5, flex: 5,
child: ListView( child: ListView(
children: [ children: [
_buildDetailRow(AppLocalizations.of(context).transactionType, // ignore: unnecessary_cast
_buildDetailRow(
AppLocalizations.of(context).transactionType as String,
transaction.type ?? ""), transaction.type ?? ""),
_buildDetailRow(AppLocalizations.of(context).transferType, _buildDetailRow(AppLocalizations.of(context).transferType,
transaction.name.split("/").first ?? ""), transaction.name.split("/").first ?? ""),
@@ -76,6 +109,30 @@ class TransactionDetailsScreen extends StatelessWidget {
], ],
), ),
), ),
// ElevatedButton.icon(
// onPressed: _shareScreenshot,
// icon: Icon(
// Icons.share_rounded,
// color: Theme.of(context).primaryColor,
// ),
// label: Text(
// AppLocalizations.of(context).share,
// style: TextStyle(color: Theme.of(context).primaryColor),
// ),
// style: ElevatedButton.styleFrom(
// backgroundColor: Theme.of(context).scaffoldBackgroundColor,
// padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 12),
// shape: RoundedRectangleBorder(
// side: BorderSide(color: Theme.of(context).primaryColor, width: 1),
// borderRadius: BorderRadius.circular(30),
// ),
// textStyle: const TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.w600,
// color: Colors.black,
// ),
// ),
// ),
], ],
), ),
), ),
@@ -93,14 +150,14 @@ class TransactionDetailsScreen extends StatelessWidget {
"$label: ", "$label: ",
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 17, fontSize: 20,
), ),
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: const TextStyle(fontSize: 16), style: const TextStyle(fontSize: 20),
), ),
), ),
], ],
@@ -108,3 +165,5 @@ class TransactionDetailsScreen extends StatelessWidget {
); );
} }
} }

View File

@@ -1,5 +1,3 @@
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';
@@ -19,7 +17,7 @@ class ThemeCubit extends Cubit<ThemeState> {
} }
Future<void> changeTheme(ThemeType type) async { Future<void> changeTheme(ThemeType type) async {
log("Attempting to change theme..."); print("Attempting to change theme to: ${type.toString()}");
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
await prefs.setInt('theme_type', type.index); await prefs.setInt('theme_type', type.index);
emit(ThemeState(themeType: type)); emit(ThemeState(themeType: type));

View File

@@ -1,23 +0,0 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'theme_mode_state.dart';
class ThemeModeCubit extends Cubit<ThemeModeState> {
ThemeModeCubit() : super(const ThemeModeState(mode: ThemeMode.system)) {
loadThemeMode();
}
Future<void> loadThemeMode() async {
final prefs = await SharedPreferences.getInstance();
final modeIndex = prefs.getInt('theme_mode') ?? 0; // default system
final mode = ThemeMode.values[modeIndex];
emit(ThemeModeState(mode: mode));
}
Future<void> changeThemeMode(ThemeMode mode) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setInt('theme_mode', mode.index);
emit(ThemeModeState(mode: mode));
}
}

View File

@@ -1,11 +0,0 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
class ThemeModeState extends Equatable {
final ThemeMode mode;
const ThemeModeState({required this.mode});
@override
List<Object?> get props => [mode];
}

View File

@@ -1,4 +1,4 @@
/*import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:kmobile/config/theme_type.dart'; import 'package:kmobile/config/theme_type.dart';
import 'package:kmobile/config/themes.dart'; import 'package:kmobile/config/themes.dart';
@@ -14,28 +14,4 @@ class ThemeState extends Equatable {
@override @override
List<Object?> get props => [themeType]; List<Object?> get props => [themeType];
}*/ }
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:kmobile/config/theme_type.dart';
import 'package:kmobile/config/themes.dart';
class ThemeState extends Equatable {
final ThemeType themeType;
const ThemeState({required this.themeType});
ThemeData getLightThemeData() {
return AppThemes.getLightTheme(themeType);
}
ThemeData getDarkThemeData() {
return AppThemes.getDarkTheme(themeType);
}
@override
List<Object?> get props => [themeType];
}

View File

@@ -23,9 +23,23 @@ class LoginScreenState extends State<LoginScreen>
final _passwordController = TextEditingController(); final _passwordController = TextEditingController();
bool _obscurePassword = true; bool _obscurePassword = true;
//bool _showWelcome = true; //bool _showWelcome = true;
late AnimationController _logoController;
late Animation<double> _logoAnimation;
@override
void initState() {
super.initState();
_logoController = AnimationController(
vsync: this,
duration: const Duration(seconds: 1),
)..repeat(reverse: true);
_logoAnimation = Tween<double>(begin: 0.2, end: 1).animate(_logoController);
}
@override @override
void dispose() { void dispose() {
_logoController.dispose();
_customerNumberController.dispose(); _customerNumberController.dispose();
_passwordController.dispose(); _passwordController.dispose();
super.dispose(); super.dispose();
@@ -49,8 +63,8 @@ class LoginScreenState extends State<LoginScreen>
if (state is Authenticated) { if (state is Authenticated) {
final storage = getIt<SecureStorage>(); final storage = getIt<SecureStorage>();
final mpin = await storage.read('mpin'); final mpin = await storage.read('mpin');
if (!context.mounted) return;
if (mpin == null) { if (mpin == null) {
// ignore: use_build_context_synchronously
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(
MaterialPageRoute( MaterialPageRoute(
builder: (_) => MPinScreen( builder: (_) => MPinScreen(
@@ -69,6 +83,7 @@ class LoginScreenState extends State<LoginScreen>
), ),
); );
} else { } else {
// ignore: use_build_context_synchronously
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (_) => const NavigationScaffold()), MaterialPageRoute(builder: (_) => const NavigationScaffold()),
); );
@@ -87,17 +102,21 @@ class LoginScreenState extends State<LoginScreen>
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset( // 🔁 Animated Blinking Logo
'assets/images/logo.png', FadeTransition(
width: 150, opacity: _logoAnimation,
height: 150, child: Image.asset(
errorBuilder: (context, error, stackTrace) { 'assets/images/logo.png',
return Icon( width: 150,
Icons.account_balance, height: 150,
size: 100, errorBuilder: (context, error, stackTrace) {
color: Theme.of(context).primaryColor, return Icon(
); Icons.account_balance,
}, size: 100,
color: Theme.of(context).primaryColor,
);
},
),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
// Title // Title
@@ -120,11 +139,11 @@ class LoginScreenState extends State<LoginScreen>
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).colorScheme.outline), borderSide: BorderSide(color: Colors.black),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2), borderSide: BorderSide(color: Colors.black, width: 2),
), ),
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
@@ -142,18 +161,19 @@ class LoginScreenState extends State<LoginScreen>
controller: _passwordController, controller: _passwordController,
obscureText: _obscurePassword, obscureText: _obscurePassword,
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
onFieldSubmitted: (_) => _submitForm(), onFieldSubmitted: (_) =>
_submitForm(), // ⌨️ Enter key submits
decoration: InputDecoration( decoration: InputDecoration(
labelText: AppLocalizations.of(context).password, labelText: AppLocalizations.of(context).password,
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).colorScheme.outline), borderSide: BorderSide(color: Colors.black),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2), borderSide: BorderSide(color: Colors.black, width: 2),
), ),
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(
@@ -187,14 +207,14 @@ class LoginScreenState extends State<LoginScreen>
backgroundColor: backgroundColor:
Theme.of(context).scaffoldBackgroundColor, Theme.of(context).scaffoldBackgroundColor,
foregroundColor: Theme.of(context).primaryColorDark, foregroundColor: Theme.of(context).primaryColorDark,
side: BorderSide(color: Theme.of(context).colorScheme.outline, width: 1), side: const BorderSide(color: Colors.black, width: 1),
elevation: 0, elevation: 0,
), ),
child: state is AuthLoading child: state is AuthLoading
? const CircularProgressIndicator() ? const CircularProgressIndicator()
: Text( : Text(
AppLocalizations.of(context).login, AppLocalizations.of(context).login,
style: TextStyle(color: Theme.of(context).colorScheme.onPrimaryContainer), style: const TextStyle(fontSize: 16),
), ),
), ),
), ),
@@ -225,11 +245,10 @@ class LoginScreenState extends State<LoginScreen>
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: const StadiumBorder(), shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Theme.of(context).colorScheme.primary, backgroundColor: Theme.of(context).primaryColorLight,
foregroundColor: Theme.of(context).colorScheme.onPrimary, foregroundColor: Colors.black,
), ),
child: Text(AppLocalizations.of(context).register, child: Text(AppLocalizations.of(context).register),
style: TextStyle(color: Theme.of(context).colorScheme.onPrimary),),
), ),
), ),
], ],

View File

@@ -1,14 +1,12 @@
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
import 'dart:math';
// import 'dart:developer'; import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:kmobile/app.dart'; import 'package:kmobile/app.dart';
import 'package:kmobile/di/injection.dart'; import 'package:kmobile/di/injection.dart';
import 'package:kmobile/security/secure_storage.dart'; import 'package:kmobile/security/secure_storage.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:flutter/services.dart';
enum MPinMode { enter, set, confirm } enum MPinMode { enter, set, confirm }
@@ -28,73 +26,22 @@ class MPinScreen extends StatefulWidget {
State<MPinScreen> createState() => _MPinScreenState(); State<MPinScreen> createState() => _MPinScreenState();
} }
class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin { class _MPinScreenState extends State<MPinScreen> {
List<String> mPin = []; List<String> mPin = [];
String? errorText; String? errorText;
// Animation controllers
late final AnimationController _bounceController;
late final Animation<double> _bounceAnimation;
late final AnimationController _shakeController;
late final AnimationController _waveController;
late final Animation<double> _waveAnimation;
// State flags for animations
bool _isError = false;
bool _isSuccess = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
// Bounce animation for single dot entry
_bounceController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 150),
);
_bounceAnimation = Tween<double>(begin: 1.0, end: 1.2).animate(
CurvedAnimation(
parent: _bounceController,
curve: Curves.elasticIn,
reverseCurve: Curves.elasticOut,
),
)..addStatusListener((status) {
if (status == AnimationStatus.completed) {
_bounceController.reverse();
}
});
// Shake animation for error
_shakeController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 400),
);
// Wave animation for success
_waveController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 800),
);
_waveAnimation = Tween<double>(begin: 0, end: 1).animate(
CurvedAnimation(parent: _waveController, curve: Curves.easeInOut),
);
if (widget.mode == MPinMode.enter) { if (widget.mode == MPinMode.enter) {
_tryBiometricBeforePin(); _tryBiometricBeforePin();
} }
} }
@override
void dispose() {
_bounceController.dispose();
_shakeController.dispose();
_waveController.dispose();
super.dispose();
}
Future<void> _tryBiometricBeforePin() async { Future<void> _tryBiometricBeforePin() async {
final storage = getIt<SecureStorage>(); final storage = getIt<SecureStorage>();
final enabled = await storage.read('biometric_enabled'); final enabled = await storage.read('biometric_enabled');
// log('biometric_enabled: $enabled'); log('biometric_enabled: $enabled');
if (enabled != null && enabled) { if (enabled != null && enabled) {
final auth = LocalAuthentication(); final auth = LocalAuthentication();
if (await auth.canCheckBiometrics) { if (await auth.canCheckBiometrics) {
@@ -115,13 +62,11 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
} }
void addDigit(String digit) { void addDigit(String digit) {
if (_shakeController.isAnimating || _waveController.isAnimating) return;
if (mPin.length < 4) { if (mPin.length < 4) {
setState(() { setState(() {
mPin.add(digit); mPin.add(digit);
errorText = null; errorText = null;
}); });
_bounceController.forward(from: 0);
if (mPin.length == 4) { if (mPin.length == 4) {
_handleComplete(); _handleComplete();
} }
@@ -129,7 +74,6 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
} }
void deleteDigit() { void deleteDigit() {
if (_shakeController.isAnimating || _waveController.isAnimating) return;
if (mPin.isNotEmpty) { if (mPin.isNotEmpty) {
setState(() { setState(() {
mPin.removeLast(); mPin.removeLast();
@@ -139,36 +83,19 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
} }
Future<void> _handleComplete() async { Future<void> _handleComplete() async {
if (_shakeController.isAnimating || _waveController.isAnimating) return;
final pin = mPin.join(); final pin = mPin.join();
final storage = SecureStorage(); final storage = SecureStorage();
switch (widget.mode) { switch (widget.mode) {
case MPinMode.enter: case MPinMode.enter:
final storedPin = await storage.read('mpin'); final storedPin = await storage.read('mpin');
// log('storedPin: $storedPin'); log('storedPin: $storedPin');
if (storedPin == int.tryParse(pin)) { if (storedPin == int.tryParse(pin)) {
// Correct PIN widget.onCompleted?.call(pin);
setState(() {
_isSuccess = true;
errorText = null;
});
await Future.delayed(const Duration(milliseconds: 100));
_waveController.forward(from: 0).whenComplete(() {
widget.onCompleted?.call(pin);
});
} else { } else {
// Incorrect PIN
setState(() { setState(() {
_isError = true;
errorText = AppLocalizations.of(context).incorrectMPIN; errorText = AppLocalizations.of(context).incorrectMPIN;
});
await _shakeController.forward(from: 0);
setState(() {
mPin.clear(); mPin.clear();
_isError = false;
// Keep error text until next digit is entered
}); });
} }
break; break;
@@ -199,81 +126,28 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
} }
} else { } else {
setState(() { setState(() {
_isError = true;
errorText = AppLocalizations.of(context).pinsDoNotMatch; errorText = AppLocalizations.of(context).pinsDoNotMatch;
});
await _shakeController.forward(from: 0);
setState(() {
mPin.clear(); mPin.clear();
_isError = false;
}); });
} }
break; break;
} }
} }
Widget buildMPinDots(BuildContext context) { Widget buildMPinDots() {
return AnimatedBuilder( return Row(
animation: Listenable.merge( mainAxisAlignment: MainAxisAlignment.center,
[_bounceController, _shakeController, _waveController]), children: List.generate(4, (index) {
builder: (context, child) { return Container(
double shakeOffset = 0; margin: const EdgeInsets.all(8),
if (_shakeController.isAnimating) { width: 15,
// 4 cycles of sine wave for shake height: 15,
shakeOffset = sin(_shakeController.value * 4 * pi) * 12; decoration: BoxDecoration(
} shape: BoxShape.circle,
color: index < mPin.length ? Colors.black : Colors.grey[400],
return Transform.translate(
offset: Offset(shakeOffset, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(4, (index) {
final isFilled = index < mPin.length;
// Bounce animation for single dot
final isAnimatingBounce =
index == mPin.length - 1 && _bounceController.isAnimating;
double bounceScale =
isAnimatingBounce ? _bounceAnimation.value : 1.0;
// Success wave animation
double waveScale = 1.0;
if (_isSuccess) {
final waveDelay = index * 0.15;
final waveValue =
(_waveAnimation.value - waveDelay).clamp(0.0, 1.0);
// Grow and shrink
waveScale = 1.0 + sin(waveValue * pi) * 0.4;
}
// Determine dot color
Color dotColor;
if (_isError) {
dotColor = Theme.of(context).colorScheme.error;
} else if (_isSuccess) {
dotColor = Colors.green.shade600;
} else {
dotColor = isFilled
? Theme.of(context).colorScheme.onSurfaceVariant
: Theme.of(context).colorScheme.surfaceContainerHighest;
}
return Transform.scale(
scale: bounceScale * waveScale,
child: Container(
margin: const EdgeInsets.all(8),
width: 25,
height: 25,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: dotColor,
),
),
);
}),
), ),
); );
}, }),
); );
} }
@@ -291,10 +165,9 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: row.map((key) { children: row.map((key) {
return Padding( return Padding(
padding: const EdgeInsets.all(1.0), padding: const EdgeInsets.all(8.0),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
HapticFeedback.lightImpact();
if (key == '<') { if (key == '<') {
deleteDigit(); deleteDigit();
} else if (key == 'Enter') { } else if (key == 'Enter') {
@@ -312,10 +185,11 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
} }
}, },
child: Container( child: Container(
width: 80, width: 70,
height: 80, height: 70,
decoration: const BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.grey[200],
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: key == 'Enter' child: key == 'Enter'
@@ -323,10 +197,10 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
: Text( : Text(
key == '<' ? '' : key, key == '<' ? '' : key,
style: TextStyle( style: TextStyle(
fontSize: 30, fontSize: 20,
color: key == 'Enter' color: key == 'Enter'
? Theme.of(context).primaryColor ? Theme.of(context).primaryColor
: Theme.of(context).colorScheme.onSurface, : Colors.black,
), ),
), ),
), ),
@@ -355,7 +229,7 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
body: SafeArea( body: SafeArea(
child: Column( child: Column(
children: [ children: [
const SizedBox(height: 50), const Spacer(),
// Logo // Logo
Image.asset('assets/images/logo.png', height: 100), Image.asset('assets/images/logo.png', height: 100),
const SizedBox(height: 20), const SizedBox(height: 20),
@@ -363,18 +237,19 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
getTitle(), getTitle(),
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w500), style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
), ),
const Spacer(), const SizedBox(height: 20),
buildMPinDots(context), buildMPinDots(),
if (errorText != null) if (errorText != null)
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
errorText!, errorText!,
style: TextStyle(color: Theme.of(context).colorScheme.error), style: const TextStyle(color: Colors.red),
), ),
), ),
const Spacer(), const Spacer(),
buildNumberPad(), buildNumberPad(),
const Spacer(),
], ],
), ),
), ),

View File

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

View File

@@ -1,10 +1,11 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/api/services/beneficiary_service.dart'; import 'package:kmobile/api/services/beneficiary_service.dart';
import 'package:kmobile/data/models/beneficiary.dart'; import 'package:kmobile/data/models/beneficiary.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import 'beneficiary_result_page.dart'; import 'beneficiary_result_page.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../di/injection.dart'; import '../../../di/injection.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart'; import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart';
@@ -45,7 +46,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() { setState(() {
accountType = 'Savings'; accountType = AppLocalizations.of(context).savings;
}); });
}); });
} }
@@ -86,17 +87,11 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
final service = getIt<BeneficiaryService>(); final service = getIt<BeneficiaryService>();
try { try {
String beneficiaryName; final String beneficiaryName = await service.validateBeneficiary(
if (ifsc.toLowerCase().contains('kace')) { accountNo: accountNo,
beneficiaryName = ifscCode: ifsc,
await service.validateBeneficiaryWithinBank(accountNo); remitterName: remitter,
} else { );
beneficiaryName = await service.validateBeneficiary(
accountNo: accountNo,
ifscCode: ifsc,
remitterName: remitter,
);
}
setState(() { setState(() {
nameController.text = beneficiaryName; nameController.text = beneficiaryName;
@@ -126,9 +121,8 @@ 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(
SnackBar( const SnackBar(
content: Text(AppLocalizations.of(context) content: Text('Please validate beneficiary details first.')),
.pleaseValidateBeneficiaryDetailsFirst)),
); );
return; return;
} }
@@ -219,10 +213,33 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
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).addBeneficiary, AppLocalizations.of(context).addBeneficiary,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, 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: SafeArea( body: SafeArea(
child: Form( child: Form(
@@ -245,6 +262,18 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
// prefixIcon: Icon(Icons.person), // prefixIcon: Icon(Icons.person),
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.black,
width: 2,
),
),
), ),
obscureText: true, obscureText: true,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
@@ -275,6 +304,18 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
// prefixIcon: Icon(Icons.person), // prefixIcon: Icon(Icons.person),
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.black,
width: 2,
),
),
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
@@ -293,6 +334,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
}, },
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
// 🔹 IFSC Code Field
TextFormField( TextFormField(
controller: ifscController, controller: ifscController,
maxLength: 11, maxLength: 11,
@@ -303,6 +345,18 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
labelText: AppLocalizations.of(context).ifscCode, labelText: AppLocalizations.of(context).ifscCode,
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.black,
width: 2,
),
),
), ),
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
@@ -340,6 +394,18 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
labelText: AppLocalizations.of(context).bankName, labelText: AppLocalizations.of(context).bankName,
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true,
fillColor: Theme.of(context)
.dialogBackgroundColor, // disabled color
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.black,
width: 2,
),
),
), ),
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
@@ -351,38 +417,19 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
labelText: AppLocalizations.of(context).branchName, labelText: AppLocalizations.of(context).branchName,
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true,
fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.black,
width: 2,
),
),
), ),
), ),
if (_isBeneficiaryValidated)
Column(
children: [
const SizedBox(height: 24),
TextFormField(
controller: nameController,
enabled: false,
decoration: InputDecoration(
suffixIcon: _isBeneficiaryValidated
? const Icon(
Symbols.verified,
size: 25,
fill: 1,
)
: null,
suffixIconColor:
Theme.of(context).colorScheme.primary,
labelText: AppLocalizations.of(context)
.beneficiaryName,
border: const OutlineInputBorder(),
isDense: true,
),
textInputAction: TextInputAction.next,
validator: (value) => value == null ||
value.isEmpty
? AppLocalizations.of(context).nameRequired
: null,
),
],
),
const SizedBox(height: 24), const SizedBox(height: 24),
if (!_isBeneficiaryValidated) if (!_isBeneficiaryValidated)
Padding( Padding(
@@ -417,6 +464,30 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
), ),
), ),
//Beneficiary Name (Disabled) //Beneficiary Name (Disabled)
TextFormField(
controller: nameController,
enabled: false,
decoration: InputDecoration(
labelText:
AppLocalizations.of(context).beneficiaryName,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black, width: 2),
),
),
textInputAction: TextInputAction.next,
validator: (value) => value == null || value.isEmpty
? AppLocalizations.of(context).nameRequired
: null,
),
const SizedBox(height: 24),
// 🔹 Account Type Dropdown // 🔹 Account Type Dropdown
DropdownButtonFormField<String>( DropdownButtonFormField<String>(
value: accountType, value: accountType,
@@ -424,10 +495,22 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
labelText: AppLocalizations.of(context).accountType, labelText: AppLocalizations.of(context).accountType,
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.black,
width: 2,
),
),
), ),
items: [ items: [
'Savings', AppLocalizations.of(context).savings,
'Current', AppLocalizations.of(context).current,
] ]
.map( .map(
(type) => DropdownMenuItem( (type) => DropdownMenuItem(
@@ -452,6 +535,18 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
prefixIcon: const Icon(Icons.phone), prefixIcon: const Icon(Icons.phone),
border: const OutlineInputBorder(), border: const OutlineInputBorder(),
isDense: true, isDense: true,
filled: true,
fillColor:
Theme.of(context).scaffoldBackgroundColor,
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.black,
width: 2,
),
),
), ),
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
validator: (value) => validator: (value) =>
@@ -466,22 +561,19 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 10), padding: const EdgeInsets.all(16.0),
child: SizedBox( child: SizedBox(
width: 250, width: 250,
child: ElevatedButton( child: ElevatedButton(
onPressed: validateAndAddBeneficiary, onPressed: validateAndAddBeneficiary,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
shape: const StadiumBorder(), shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: backgroundColor: Theme.of(context).primaryColorDark,
Theme.of(context).colorScheme.primaryContainer, foregroundColor:
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
Theme.of(context).colorScheme.onPrimaryContainer),
child: Text(
AppLocalizations.of(context).validateAndAdd,
style: const TextStyle(fontSize: 16),
), ),
child: Text(AppLocalizations.of(context).validateAndAdd),
), ),
), ),
), ),

View File

@@ -1,163 +0,0 @@
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: SafeArea(
child: 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, context),
),
const SizedBox(width: 16),
Text(
beneficiary.name,
style: const TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
),
],
),
const SizedBox(height: 24),
_buildDetailRow('${AppLocalizations.of(context).bankName} ',
beneficiary.bankName ?? 'N/A'),
_buildDetailRow('${AppLocalizations.of(context).accountNumber} ',
beneficiary.accountNo),
_buildDetailRow('${AppLocalizations.of(context).accountType} ',
beneficiary.accountType),
_buildDetailRow('${AppLocalizations.of(context).ifscCode} ',
beneficiary.ifscCode),
_buildDetailRow('${AppLocalizations.of(context).branchName} ',
beneficiary.branchName ?? 'N/A'),
const Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
// ElevatedButton.icon(
// onPressed: () {
// // Set Transaction Limit for this beneficiary
// },
// icon: const Icon(Icons.currency_rupee),
// label: const Text('Set Limit'),
// ),
ElevatedButton.icon(
onPressed: () {
// Delete beneficiary option
_showDeleteConfirmationDialog(context);
},
icon: const Icon(Icons.delete),
label: Text(AppLocalizations.of(context).delete),
),
],
),
],
),
),
),
);
}
Widget _buildDetailRow(String label, String value) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label, style: const TextStyle(fontWeight: FontWeight.bold)),
const SizedBox(width: 16),
Flexible(
child: Text(
value,
textAlign: TextAlign.end,
),
),
],
),
);
}
}

View File

@@ -90,7 +90,7 @@ class _BeneficiaryResultPageState extends State<BeneficiaryResultPage> {
), ),
child: Text( child: Text(
AppLocalizations.of(context).done, AppLocalizations.of(context).done,
style: TextStyle(color: Theme.of(context).colorScheme.onPrimaryContainer), // slightly bigger text style: const TextStyle(fontSize: 18), // slightly bigger text
), ),
), ),
), ),

View File

@@ -1,12 +1,10 @@
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';
import 'package:shimmer/shimmer.dart'; import 'package:shimmer/shimmer.dart';
import 'package:kmobile/widgets/bank_logos.dart';
class ManageBeneficiariesScreen extends StatefulWidget { class ManageBeneficiariesScreen extends StatefulWidget {
final String customerName; final String customerName;
@@ -62,6 +60,80 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
); );
} }
Widget _getBankLogo(String? bankName) {
if (bankName != null && bankName.toLowerCase().contains('state bank of')) {
return Image.asset(
'assets/images/sbi_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('kangra central')) {
return Image.asset(
'assets/images/icon.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('hdfc bank ltd')) {
return Image.asset(
'assets/images/hdfc_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('icici bank ltd')) {
return Image.asset(
'assets/images/icici_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null &&
bankName.toLowerCase().contains('punjab national bank')) {
return Image.asset(
'assets/images/pnb_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('axis')) {
return Image.asset(
'assets/images/axisBank_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('baroda')) {
return Image.asset(
'assets/images/bankofBaroda_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('canara bank')) {
return Image.asset(
'assets/images/canaraBank_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('kotak')) {
return Image.asset(
'assets/images/kotak_logo.png',
width: 40,
height: 40,
);
}
else {
return const Icon(
Icons.account_balance,
size: 40,
color: Colors.grey,
);
}
}
Widget _buildBeneficiaryList() { Widget _buildBeneficiaryList() {
if (_beneficiaries.isEmpty) { if (_beneficiaries.isEmpty) {
return Center( return Center(
@@ -75,7 +147,7 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
leading: CircleAvatar( leading: CircleAvatar(
radius: 24, radius: 24,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
child: getBankLogo(item.bankName, context), child: _getBankLogo(item.bankName),
), ),
title: Text(item.name), title: Text(item.name),
subtitle: Column( subtitle: Column(
@@ -89,14 +161,6 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
), ),
], ],
), ),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => BeneficiaryDetailsScreen(beneficiary: item),
),
);
},
); );
}, },
); );
@@ -122,6 +186,8 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
), ),
); );
}, },
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
foregroundColor: Theme.of(context).primaryColor,
elevation: 5, elevation: 5,
child: const Icon(Icons.add), child: const Icon(Icons.add),
), ),

View File

@@ -1,6 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
class BlockCardScreen extends StatefulWidget { class BlockCardScreen extends StatefulWidget {
const BlockCardScreen({super.key}); const BlockCardScreen({super.key});
@@ -54,12 +56,33 @@ class _BlockCardScreen extends State<BlockCardScreen> {
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).blockCard, AppLocalizations.of(context).blockCard,
style: style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500), const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, 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: Padding( body: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),

View File

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

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/features/card/screens/block_card_screen.dart'; import 'package:kmobile/features/card/screens/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';
@@ -20,8 +20,25 @@ class _CardManagementScreen extends State<CardManagementScreen> {
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
title: Text( title: Text(
AppLocalizations.of(context).cardManagement, AppLocalizations.of(context).cardManagement,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, 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: [
@@ -57,19 +74,6 @@ class _CardManagementScreen extends State<CardManagementScreen> {
}, },
), ),
const Divider(height: 1), const Divider(height: 1),
CardManagementTile(
icon: Symbols.payment_card,
label: AppLocalizations.of(context).viewCardDeatils,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CardDetailsScreen(),
),
);
},
),
const Divider(height: 1),
], ],
), ),
); );

View File

@@ -1,6 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:kmobile/features/card/screens/card_pin_set_screen.dart'; import 'package:kmobile/features/card/screens/card_pin_set_screen.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
class CardPinChangeDetailsScreen extends StatefulWidget { class CardPinChangeDetailsScreen extends StatefulWidget {
@@ -44,12 +46,33 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
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).cardDetails, AppLocalizations.of(context).cardDetails,
style: style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500), const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, 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: Padding( body: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),

View File

@@ -1,4 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
class CardPinSetScreen extends StatefulWidget { class CardPinSetScreen extends StatefulWidget {
@@ -44,12 +46,33 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
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).cardPin, AppLocalizations.of(context).cardPin,
style: style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500), const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, 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: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/features/enquiry/screens/enquiry_screen.dart'; import 'package:kmobile/features/enquiry/screens/enquiry_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';
@@ -15,12 +16,33 @@ class _ChequeManagementScreen extends State<ChequeManagementScreen> {
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).chequeManagement, AppLocalizations.of(context).chequeManagement,
style: style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500), const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, centerTitle: false,
actions: [
Padding(
padding: const EdgeInsets.only(right: 10.0),
child: CircleAvatar(
backgroundColor: Colors.grey[200],
radius: 20,
child: SvgPicture.asset(
'assets/images/avatar_male.svg',
width: 40,
height: 40,
fit: BoxFit.cover,
),
),
),
],
), ),
body: ListView( body: ListView(
children: [ children: [

View File

@@ -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/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 {
@@ -15,14 +16,34 @@ 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(
title: Text( leading: IconButton(
AppLocalizations.of(context) icon: const Icon(Symbols.arrow_back_ios_new),
.customerInfo onPressed: () {
.replaceFirst(RegExp('\n'), ''), Navigator.pop(context);
},
), ),
title: Text(
AppLocalizations.of(context).kMobile,
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(),
@@ -34,6 +55,7 @@ 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',
@@ -46,18 +68,16 @@ 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: TextStyle( style: const TextStyle(
fontSize: 20, fontSize: 20,
color: theme.colorScheme.onSurface, color: Colors.black,
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: TextStyle( style: const TextStyle(fontSize: 16, color: Colors.grey),
fontSize: 16,
color: theme.colorScheme.onSurfaceVariant),
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
InfoField( InfoField(
@@ -105,7 +125,6 @@ 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),
@@ -114,16 +133,16 @@ class InfoField extends StatelessWidget {
children: [ children: [
Text( Text(
label, label,
style: TextStyle( style: const TextStyle(
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: theme.colorScheme.onSurfaceVariant, color: Colors.black87,
), ),
), ),
const SizedBox(height: 3), const SizedBox(height: 3),
Text( Text(
value, value,
style: TextStyle(fontSize: 16, color: theme.colorScheme.onSurface), style: const TextStyle(fontSize: 16, color: Colors.black),
), ),
], ],
), ),

View File

@@ -1,3 +1,4 @@
// 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';
@@ -12,7 +13,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_screen.dart'; import 'package:kmobile/features/fund_transfer/screens/fund_transfer_beneficiary_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';
@@ -81,11 +82,8 @@ 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(
SnackBar( /*const*/ SnackBar(
content: Text(AppLocalizations.of(context).failedToRefresh), content: Text(AppLocalizations.of(context).failedToRefresh),
), ),
); );
@@ -96,12 +94,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
} }
Widget _buildBalanceShimmer() { Widget _buildBalanceShimmer() {
final theme = Theme.of(context);
return Shimmer.fromColors( return Shimmer.fromColors(
baseColor: theme.colorScheme.primary, baseColor: Theme.of(context).dialogBackgroundColor,
highlightColor: theme.colorScheme.onPrimary, highlightColor: Theme.of(context).dialogBackgroundColor,
child: Container( child: Container(
width: 200, height: 42, color: theme.scaffoldBackgroundColor), width: 100,
height: 32,
color: Theme.of(context).scaffoldBackgroundColor),
); );
} }
@@ -170,7 +169,6 @@ 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(
@@ -181,7 +179,6 @@ 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),
@@ -193,7 +190,6 @@ 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) {
@@ -206,15 +202,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
} }
}, },
child: Scaffold( child: Scaffold(
backgroundColor: theme.scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: AppBar( appBar: AppBar(
backgroundColor: theme.scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
title: Text( title: Text(
AppLocalizations.of(context).kconnect, AppLocalizations.of(context).kconnect,
style: TextStyle( style: TextStyle(
color: theme.colorScheme.primary, color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w500,
), ),
), ),
centerTitle: true, centerTitle: true,
@@ -272,10 +268,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.baumans().copyWith( style: GoogleFonts.montserrat().copyWith(
fontSize: 20, fontSize: 25,
color: theme.colorScheme.primary, color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
@@ -289,7 +285,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
vertical: 10, vertical: 10,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: theme.colorScheme.primary, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Column(
@@ -298,22 +294,24 @@ class _DashboardScreenState extends State<DashboardScreen> {
Row( Row(
children: [ children: [
Text( Text(
"${getFullAccountType(currAccount.accountType)}: ", "${AppLocalizations.of(context).accountNumber}: ",
style: TextStyle( style: TextStyle(
color: theme.colorScheme.onPrimary, color:
fontSize: 18, Theme.of(context).dialogBackgroundColor,
fontWeight: FontWeight.w700, fontSize: 12,
), ),
), ),
DropdownButton<int>( DropdownButton<int>(
value: selectedAccountIndex, value: selectedAccountIndex,
dropdownColor: theme.colorScheme.primary, dropdownColor: Theme.of(context).primaryColor,
underline: const SizedBox(), underline: const SizedBox(),
icon: const Icon(Icons.keyboard_arrow_down), icon: const Icon(Icons.keyboard_arrow_down),
iconEnabledColor: theme.colorScheme.onPrimary, iconEnabledColor:
Theme.of(context).dialogBackgroundColor,
style: TextStyle( style: TextStyle(
color: theme.colorScheme.onPrimary, color:
fontSize: 18, Theme.of(context).dialogBackgroundColor,
fontSize: 14,
), ),
items: List.generate(users.length, (index) { items: List.generate(users.length, (index) {
return DropdownMenuItem<int>( return DropdownMenuItem<int>(
@@ -321,9 +319,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.colorScheme.onPrimary, color: Theme.of(context)
fontSize: 18, .dialogBackgroundColor,
fontWeight: FontWeight.w700, fontSize: 14,
), ),
), ),
); );
@@ -362,13 +360,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: 20, width: 20,
height: 20, height: 20,
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: theme.colorScheme.onPrimary, color: Theme.of(context)
.dialogBackgroundColor,
strokeWidth: 2, strokeWidth: 2,
), ),
) )
: Icon( : Icon(
Symbols.refresh, Icons.refresh,
color: theme.colorScheme.onPrimary, color: Theme.of(context)
.dialogBackgroundColor,
), ),
onPressed: isRefreshing onPressed: isRefreshing
? null ? null
@@ -377,14 +377,22 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
], ],
), ),
const SizedBox(height: 15), Text(
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: theme.colorScheme.onPrimary, color:
Theme.of(context).dialogBackgroundColor,
fontSize: 40, fontSize: 40,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@@ -395,9 +403,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
isVisible isVisible
? currAccount.currentBalance ?? ? currAccount.currentBalance ??
'0.00' '0.00'
: '*****', : '********',
style: TextStyle( style: TextStyle(
color: theme.colorScheme.onPrimary, color: Theme.of(context)
.dialogBackgroundColor,
fontSize: 40, fontSize: 40,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@@ -423,15 +432,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
}); });
} }
}, },
child: Padding( child: Icon(
padding: const EdgeInsets.all(8.0), isVisible
child: Icon( ? Symbols.visibility_lock
isVisible : Symbols.visibility,
? Symbols.visibility_lock color: Theme.of(context)
: Symbols.visibility, .scaffoldBackgroundColor,
color: theme.scaffoldBackgroundColor,
weight: 800,
),
), ),
), ),
], ],
@@ -486,13 +492,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => FundTransferScreen( builder: (context) =>
creditAccountNo: FundTransferBeneficiaryScreen(
users[selectedAccountIndex] creditAccountNo:
.accountNo!, users[selectedAccountIndex]
remitterName: .accountNo!,
users[selectedAccountIndex] remitterName:
.name!))); users[selectedAccountIndex]
.name!)));
}, disable: false), }, disable: false),
_buildQuickLink( _buildQuickLink(
Symbols.server_person, Symbols.server_person,
@@ -519,8 +526,6 @@ 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,
@@ -563,25 +568,24 @@ class _DashboardScreenState extends State<DashboardScreen> {
tx.type == 'CR' tx.type == 'CR'
? Symbols.call_received ? Symbols.call_received
: Symbols.call_made, : Symbols.call_made,
color: tx.type == 'CR' color:
? const Color(0xFF10BB10) tx.type == 'CR' ? Colors.green : Colors.red,
: theme.colorScheme.error,
), ),
title: Text( title: Text(
tx.date ?? '',
style: const TextStyle(fontSize: 15),
),
subtitle: Text(
tx.name != null tx.name != null
? (tx.name!.length > 18 ? (tx.name!.length > 18
? tx.name!.substring(0, 22) ? tx.name!.substring(0, 22)
: tx.name!) : tx.name!)
: '', : '',
style: const TextStyle(fontSize: 14),
),
subtitle: Text(
tx.date ?? '',
style: const TextStyle(fontSize: 12), style: const TextStyle(fontSize: 12),
), ),
trailing: Text( trailing: Text(
"${tx.amount}", "${tx.amount}",
style: const TextStyle(fontSize: 17), style: const TextStyle(fontSize: 16),
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@@ -602,7 +606,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
AppLocalizations.of(context).noTransactions, AppLocalizations.of(context).noTransactions,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Theme.of(context).colorScheme.outline, color: Colors.grey[600],
), ),
), ),
), ),
@@ -622,26 +626,30 @@ 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, backgroundColor: theme.scaffoldBackgroundColor), radius: 12,
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, width: 100, color: theme.scaffoldBackgroundColor), height: 10,
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, width: 60, color: theme.scaffoldBackgroundColor), height: 8,
width: 60,
color: Theme.of(context).scaffoldBackgroundColor),
), ),
); );
}); });
@@ -653,7 +661,6 @@ 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(
@@ -662,11 +669,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Icon( Icon(
icon, icon,
size: 30, size: 30,
color: disable color: disable ? Colors.grey : Theme.of(context).primaryColor,
? theme.colorScheme.onSurface.withOpacity(0.3)
: theme.colorScheme.primary,
grade: 200,
weight: 700,
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(

View File

@@ -13,7 +13,15 @@ class AccountCard extends StatelessWidget {
width: 300, width: 300,
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, // gradient: LinearGradient(
// begin: Alignment.topLeft,
// end: Alignment.bottomRight,
// colors: [
// Theme.of(context).primaryColor,
// Theme.of(context).primaryColor.withBlue(200),
// ],
// ),
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@@ -33,7 +41,7 @@ class AccountCard extends StatelessWidget {
Text( Text(
account.accountType, account.accountType,
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary, color: Theme.of(context).scaffoldBackgroundColor,
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -42,7 +50,7 @@ class AccountCard extends StatelessWidget {
account.accountType == 'Savings' account.accountType == 'Savings'
? Icons.savings ? Icons.savings
: Icons.account_balance, : Icons.account_balance,
color: Theme.of(context).colorScheme.onPrimary, color: Theme.of(context).scaffoldBackgroundColor,
), ),
], ],
), ),
@@ -50,13 +58,13 @@ class AccountCard extends StatelessWidget {
Text( Text(
account.accountNumber, account.accountNumber,
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary, fontSize: 16), color: Theme.of(context).dialogBackgroundColor, fontSize: 16),
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
Text( Text(
'${account.currency} ${account.balance.toStringAsFixed(2)}', '${account.currency} ${account.balance.toStringAsFixed(2)}',
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary, color: Theme.of(context).scaffoldBackgroundColor,
fontSize: 22, fontSize: 22,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -65,11 +73,10 @@ class AccountCard extends StatelessWidget {
Text( Text(
AppLocalizations.of(context).availableBalance, AppLocalizations.of(context).availableBalance,
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary, fontSize: 16), color: Theme.of(context).dialogBackgroundColor, fontSize: 12),
), ),
], ],
), ),
); );
} }
} }

View File

@@ -1,6 +1,8 @@
// ignore_for_file: use_build_context_synchronously // ignore_for_file: use_build_context_synchronously
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
@@ -34,13 +36,12 @@ class _EnquiryScreen extends State<EnquiryScreen> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(role, Text(role, style: const TextStyle(color: Colors.grey)),
style: TextStyle(color: Theme.of(context).colorScheme.onSurface)),
const SizedBox(height: 4), const SizedBox(height: 4),
GestureDetector( GestureDetector(
onTap: () => _launchEmailAddress(email), onTap: () => _launchEmailAddress(email),
child: Text(email, child: Text(email,
style: TextStyle(color: Theme.of(context).colorScheme.primary)), style: TextStyle(color: Theme.of(context).primaryColor)),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
GestureDetector( GestureDetector(
@@ -57,8 +58,33 @@ class _EnquiryScreen extends State<EnquiryScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context).enquiry), leading: IconButton(
icon: const Icon(Symbols.arrow_back_ios_new),
onPressed: () {
Navigator.pop(context);
},
),
title: Text(
AppLocalizations.of(context).enquiry,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
),
centerTitle: false, 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: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
@@ -69,11 +95,12 @@ class _EnquiryScreen extends State<EnquiryScreen> {
const SizedBox(height: 20), const SizedBox(height: 20),
Text( Text(
AppLocalizations.of(context).writeToUs, AppLocalizations.of(context).writeToUs,
style: const TextStyle(color: Colors.grey),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
"complaint@kccb.in", "complaint@kccb.in",
style: TextStyle(color: Theme.of(context).colorScheme.primary), style: TextStyle(color: Theme.of(context).primaryColor),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
@@ -81,11 +108,11 @@ class _EnquiryScreen extends State<EnquiryScreen> {
AppLocalizations.of(context).keyContacts, AppLocalizations.of(context).keyContacts,
style: TextStyle( style: TextStyle(
fontSize: 17, fontSize: 17,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).primaryColor,
), ),
// horizontal line // horizontal line
), ),
Divider(color: Theme.of(context).colorScheme.outline), Divider(color: Colors.grey[300]),
const SizedBox(height: 16), const SizedBox(height: 16),
_buildContactItem( _buildContactItem(
AppLocalizations.of(context).chairman, AppLocalizations.of(context).chairman,

View File

@@ -1,12 +1,10 @@
// ignore_for_file: avoid_print
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:kmobile/api/services/neft_service.dart'; import 'package:kmobile/api/services/neft_service.dart';
import 'package:kmobile/api/services/rtgs_service.dart'; import 'package:kmobile/api/services/rtgs_service.dart';
import 'package:kmobile/api/services/imps_service.dart';
import 'package:kmobile/data/models/imps_transaction.dart';
import 'package:kmobile/widgets/bank_logos.dart';
import 'package:kmobile/data/models/beneficiary.dart'; import 'package:kmobile/data/models/beneficiary.dart';
import 'package:kmobile/data/models/neft_transaction.dart'; import 'package:kmobile/data/models/neft_transaction.dart';
import 'package:kmobile/data/models/payment_response.dart'; import 'package:kmobile/data/models/payment_response.dart';
@@ -15,23 +13,19 @@ 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 }
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,244 +44,235 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
super.dispose(); super.dispose();
} }
Widget _getBankLogo(String? bankName) {
if (bankName != null &&
bankName.toLowerCase().contains('state bank of india')) {
return Image.asset(
'assets/images/sbi_logo.png',
width: 40,
height: 40,
);
} else {
return const Icon(
Icons.account_balance,
size: 40,
color: Colors.grey,
);
}
}
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( if (_selectedMode == TransactionMode.rtgs && amount < 200000) {
context, showDialog(
MaterialPageRoute( context: context,
builder: (context) => TransactionPinScreen( builder: (ctx) => AlertDialog(
onPinCompleted: (pinScreenContext, tpin) async { title: Text(AppLocalizations.of(context).invalidRtgs),
final transfer = Transfer( content: Text(AppLocalizations.of(context).invalidRtgsPopUp),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: Text(AppLocalizations.of(context).ok),
),
],
),
);
return; // Stop further execution
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TransactionPinScreen(
onPinCompleted: (pinScreenContext, tpin) async {
if (_selectedMode == TransactionMode.neft) {
final neftTx = NeftTransaction(
fromAccount: widget.debitAccountNo, fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo, toAccount: widget.creditBeneficiary.accountNo,
toAccountType: 'Savings', // Assuming 'SB' for savings
amount: _amountController.text, amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin, tpin: tpin,
); );
final neftService = getIt<NeftService>();
final paymentService = getIt<PaymentService>(); final completer = Completer<PaymentResponse>();
final paymentResponseFuture =
paymentService.processQuickPayWithinBank(transfer);
Navigator.of(pinScreenContext).pushReplacement( Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute( MaterialPageRoute(
builder: (_) => PaymentAnimationScreen( builder: (_) => PaymentAnimationScreen(
paymentResponse: paymentResponseFuture), paymentResponse: completer.future),
), ),
); );
},
), try {
final neftResponse =
await neftService.processNeftTransaction(neftTx);
final paymentResponse = PaymentResponse(
isSuccess: neftResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: neftTx.toAccount,
amount: neftTx.amount,
currency: 'INR',
utr: neftResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
print('dio exception');
print(e.toString());
final error = jsonDecode(e.response.toString())['error'];
var errorMessage = {
"INCORRECT_TPIN":
AppLocalizations.of(context).correctTpin,
"INSUFFICIENT_FUNDS":
AppLocalizations.of(context).insufficientFund
}[error] ??
AppLocalizations.of(context).somethingWentWrong;
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
print('generic exception');
print(e.toString());
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage:
AppLocalizations.of(context).somethingWentWrong,
);
completer.complete(paymentResponse);
}
}
// else if (_selectedMode == TransactionMode.imps){
// final rtgsTx = RtgsTransaction(
// fromAccount: widget.debitAccountNo,
// toAccount: widget.creditBeneficiary.accountNo,
// amount: _amountController.text,
// ifscCode: widget.creditBeneficiary.ifscCode,
// remitterName: widget.remitterName,
// beneficiaryName: widget.creditBeneficiary.name,
// tpin: tpin,
// );
// final rtgsService = getIt<RtgsService>();
// final completer = Completer<PaymentResponse>();
// Navigator.of(pinScreenContext).pushReplacement(
// MaterialPageRoute(
// builder: (_) => PaymentAnimationScreen(
// paymentResponse: completer.future),
// ),
// );
// try {
// final rtgsResponse =
// await rtgsService.processRtgsTransaction(rtgsTx);
// final paymentResponse = PaymentResponse(
// isSuccess: rtgsResponse.message.toUpperCase() == 'SUCCESS',
// date: DateTime.now(),
// creditedAccount: rtgsTx.toAccount,
// amount: rtgsTx.amount,
// currency: 'INR',
// utr: rtgsResponse.utr,
// );
// completer.complete(paymentResponse);
// } on DioException catch(e) {
// print('dio exception');
// print(e.toString());
// final error = jsonDecode(e.response.toString())['error'];
// var errorMessage =
// {
// "INCORRECT_TPIN" : "Please Enter the correct TPIN",
// "INSUFFICIENT_FUNDS": "Your account does not have sufficient balance"
// }[error] ?? "Something Went Wrong";
// final paymentResponse = PaymentResponse(
// isSuccess: false,
// errorMessage: errorMessage,
// );
// completer.complete(paymentResponse);
// } catch (e) {
// print('generic exception');
// print(e.toString());
// final paymentResponse = PaymentResponse(
// isSuccess: false,
// errorMessage: "Something went Wrong",
// );
// completer.complete(paymentResponse);
// }
// }
else {
final rtgsTx = RtgsTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
final rtgsService = getIt<RtgsService>();
final completer = Completer<PaymentResponse>();
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final rtgsResponse =
await rtgsService.processRtgsTransaction(rtgsTx);
final paymentResponse = PaymentResponse(
isSuccess: rtgsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: rtgsTx.toAccount,
amount: rtgsTx.amount,
currency: 'INR',
utr: rtgsResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
print('dio exception');
print(e.toString());
final error = jsonDecode(e.response.toString())['error'];
var errorMessage = {
"INCORRECT_TPIN":
AppLocalizations.of(context).correctTpin,
"INSUFFICIENT_FUNDS":
AppLocalizations.of(context).insufficientFund
// ignore: use_build_context_synchronously
}[error] ??
AppLocalizations.of(context).somethingWentWrong;
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
print('generic exception');
print(e.toString());
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage:
AppLocalizations.of(context).somethingWentWrong,
);
completer.complete(paymentResponse);
}
}
},
), ),
); ),
} else { );
if (_selectedMode == TransactionMode.rtgs && amount < 200000) {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: Text(AppLocalizations.of(context).invalidRtgs),
content: Text(AppLocalizations.of(context).invalidRtgsPopUp),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: Text(AppLocalizations.of(context).ok),
),
],
),
);
return; // Stop further execution
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TransactionPinScreen(
onPinCompleted: (pinScreenContext, tpin) async {
if (_selectedMode == TransactionMode.neft) {
final neftTx = NeftTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
final neftService = getIt<NeftService>();
final completer = Completer<PaymentResponse>();
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final neftResponse =
await neftService.processNeftTransaction(neftTx);
final paymentResponse = PaymentResponse(
isSuccess:
neftResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: neftTx.toAccount,
amount: neftTx.amount,
currency: 'INR',
utr: neftResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
String errorMessage;
if (e.response != null && e.response!.data != null) {
try {
// final error = jsonDecode(e.response!.toString())['error'];
final error = e.response?.data['error'];
errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
}[error] ??
"Something Went Wrong";
} catch (_) {
errorMessage = "Something Went Wrong";
}
} else {
errorMessage = "Something Went Wrong";
}
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
if (!pinScreenContext.mounted) return;
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: AppLocalizations.of(pinScreenContext)
.somethingWentWrong,
);
completer.complete(paymentResponse);
}
}
//IMPS transaction
else if (_selectedMode == TransactionMode.imps) {
final impsTx = ImpsTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
final impsService = getIt<ImpsService>();
final completer = Completer<PaymentResponse>();
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final impsResponse =
await impsService.processImpsTransaction(impsTx);
final paymentResponse = PaymentResponse(
isSuccess:
impsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: impsTx.toAccount,
amount: impsTx.amount,
currency: 'INR',
utr: impsResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
final error = jsonDecode(e.response.toString())['error'];
var errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
}[error] ??
"Something Went Wrong";
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: "Something went Wrong",
);
completer.complete(paymentResponse);
}
}
//RTGS
else {
final rtgsTx = RtgsTransaction(
fromAccount: widget.debitAccountNo,
toAccount: widget.creditBeneficiary.accountNo,
amount: _amountController.text,
ifscCode: widget.creditBeneficiary.ifscCode,
remitterName: widget.remitterName,
beneficiaryName: widget.creditBeneficiary.name,
tpin: tpin,
);
final rtgsService = getIt<RtgsService>();
final completer = Completer<PaymentResponse>();
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final rtgsResponse =
await rtgsService.processRtgsTransaction(rtgsTx);
final paymentResponse = PaymentResponse(
isSuccess:
rtgsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: rtgsTx.toAccount,
amount: rtgsTx.amount,
currency: 'INR',
utr: rtgsResponse.utr,
);
completer.complete(paymentResponse);
} on DioException catch (e) {
final error = jsonDecode(e.response.toString())['error'];
var errorMessage = {
"INCORRECT_TPIN": "Please Enter the correct TPIN",
"INSUFFICIENT_FUNDS":
"Your account does not have sufficient balance"
// ignore: use_build_context_synchronously
}[error] ??
"Something Went Wrong";
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: errorMessage,
);
completer.complete(paymentResponse);
} catch (e) {
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: "Something Went Wrong",
);
completer.complete(paymentResponse);
}
}
},
),
),
);
}
} }
} }
@@ -296,142 +281,136 @@ class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
final loc = AppLocalizations.of(context); final loc = AppLocalizations.of(context);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(loc.fundTransfer.replaceFirst(RegExp('\n'), '')), title: Text(loc.fundTransfer),
), ),
body: SafeArea( body: Padding(
child: Padding( padding: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(16.0), child: Form(
child: Form( key: _formKey,
key: _formKey, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ // Debit Account (User)
// Debit Account (User) Text(
Text( loc.debitFrom,
loc.debitFrom, style: Theme.of(context).textTheme.titleSmall,
style: Theme.of(context).textTheme.titleSmall, ),
), Card(
Card( elevation: 0,
elevation: 0, margin: const EdgeInsets.symmetric(vertical: 8.0),
margin: const EdgeInsets.symmetric(vertical: 8.0), child: ListTile(
child: ListTile( leading: Image.asset(
leading: Image.asset( 'assets/images/logo.png',
'assets/images/logo.png', width: 40,
width: 40, height: 40,
height: 40,
),
title: Text(widget.remitterName),
subtitle: Text(widget.debitAccountNo),
), ),
title: Text(widget.remitterName),
subtitle: Text(widget.debitAccountNo),
), ),
const SizedBox(height: 24), ),
const SizedBox(height: 24),
// Credit Account (Beneficiary) // Credit Account (Beneficiary)
Text( Text(
AppLocalizations.of(context).creditedTo, AppLocalizations.of(context).creditedTo,
style: Theme.of(context).textTheme.titleSmall, style: Theme.of(context).textTheme.titleSmall,
),
Card(
elevation: 0,
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading: _getBankLogo(widget.creditBeneficiary.bankName),
title: Text(widget.creditBeneficiary.name),
subtitle: Text(widget.creditBeneficiary.accountNo),
), ),
Card( ),
elevation: 0, const SizedBox(height: 24),
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ListTile(
leading:
getBankLogo(widget.creditBeneficiary.bankName, context),
title: Text(widget.creditBeneficiary.name),
subtitle: Text(widget.creditBeneficiary.accountNo),
),
),
const SizedBox(height: 24),
if (!widget.isOwnBank) ...[ // Transaction Mode Selection
// Transaction Mode Selection Text(
Text( AppLocalizations.of(context).selectTransactionType,
AppLocalizations.of(context).selectTransactionType, style: Theme.of(context).textTheme.titleMedium,
style: Theme.of(context).textTheme.titleMedium, ),
), const SizedBox(height: 12),
const SizedBox(height: 12), Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( color: Theme.of(context).cardColor,
color: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(12), border: Border.all(color: Colors.grey.shade300),
border: Border.all(color: Colors.grey.shade300), ),
), child: ToggleButtons(
child: ToggleButtons( isSelected: [
isSelected: [ _selectedMode == TransactionMode.neft,
_selectedMode == TransactionMode.neft, _selectedMode == TransactionMode.rtgs
_selectedMode == TransactionMode.rtgs, ],
_selectedMode == TransactionMode.imps, onPressed: (index) {
], setState(() {
onPressed: (index) { _selectedMode = TransactionMode.values[index];
setState(() { });
_selectedMode = TransactionMode.values[index];
});
},
borderRadius: BorderRadius.circular(10),
selectedColor: Theme.of(context).colorScheme.onPrimary,
fillColor: Theme.of(context).colorScheme.primary,
color: Theme.of(context).colorScheme.onSurface,
borderColor: Colors.transparent,
selectedBorderColor: Colors.transparent,
splashColor: Theme.of(context).colorScheme.primary,
highlightColor: Theme.of(context).colorScheme.primary,
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).neft),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).rtgs),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).imps),
),
],
),
),
const SizedBox(height: 24),
],
// Amount
TextFormField(
controller: _amountController,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: loc.amount,
border: const OutlineInputBorder(),
prefixIcon: const Icon(Icons.currency_rupee),
),
validator: (value) {
if (value == null || value.isEmpty) {
return loc.amountRequired;
}
if (double.tryParse(value) == null ||
double.parse(value) <= 0) {
return loc.validAmount;
}
return null;
}, },
), borderRadius: BorderRadius.circular(10),
const Spacer(), selectedColor: Theme.of(context).colorScheme.onPrimary,
fillColor: Theme.of(context).primaryColor,
// Proceed Button color: Theme.of(context).colorScheme.onSurface,
SizedBox( borderColor: Colors.transparent,
width: double.infinity, selectedBorderColor: Colors.transparent,
child: ElevatedButton( splashColor: Theme.of(context).primaryColor.withOpacity(0.1),
onPressed: _onProceed, highlightColor:
style: ElevatedButton.styleFrom( Theme.of(context).primaryColor.withOpacity(0.05),
padding: const EdgeInsets.symmetric(vertical: 16), children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).neft),
), ),
child: Text(AppLocalizations.of(context).proceed), Padding(
), padding: const EdgeInsets.symmetric(
horizontal: 24.0, vertical: 12.0),
child: Text(AppLocalizations.of(context).rtgs),
),
// Padding(
// padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0),
// child: Text(AppLocalizations.of(context).imps),
// ),
],
), ),
const SizedBox(height: 10), ),
], const SizedBox(height: 24),
),
// Amount
TextFormField(
controller: _amountController,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: loc.amount,
border: const OutlineInputBorder(),
prefixIcon: const Icon(Icons.currency_rupee),
),
validator: (value) {
if (value == null || value.isEmpty) {
return loc.amountRequired;
}
if (double.tryParse(value) == null ||
double.parse(value) <= 0) {
return loc.validAmount;
}
return null;
},
),
const Spacer(),
// Proceed Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: _onProceed,
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 16),
),
child: Text(AppLocalizations.of(context).proceed),
),
),
],
), ),
), ),
), ),

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:kmobile/widgets/bank_logos.dart';
import 'package:kmobile/data/models/beneficiary.dart'; import 'package:kmobile/data/models/beneficiary.dart';
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_amount_screen.dart'; import 'package:kmobile/features/fund_transfer/screens/fund_transfer_amount_screen.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
@@ -10,12 +9,8 @@ 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, {super.key, required this.creditAccountNo, required this.remitterName});
required this.creditAccountNo,
required this.remitterName,
required this.isOwnBank});
@override @override
State<FundTransferBeneficiaryScreen> createState() => State<FundTransferBeneficiaryScreen> createState() =>
@@ -37,12 +32,7 @@ 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;
}); });
} }
@@ -73,6 +63,51 @@ class _FundTransferBeneficiaryScreenState
); );
} }
Widget _getBankLogo(String? bankName) {
if (bankName != null && bankName.toLowerCase().contains('state bank ')) {
return Image.asset(
'assets/images/sbi_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('kangra central')) {
return Image.asset(
'assets/images/icon.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('hdfc bank ltd')) {
return Image.asset(
'assets/images/hdfc_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('icici bank ltd')) {
return Image.asset(
'assets/images/icici_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null &&
bankName.toLowerCase().contains('punjab national bank')) {
return Image.asset(
'assets/images/pnb_logo.png',
width: 40,
height: 40,
);
} else {
return const Icon(
Icons.account_balance,
size: 40,
color: Colors.grey,
);
}
}
Widget _buildBeneficiaryList() { Widget _buildBeneficiaryList() {
if (_beneficiaries.isEmpty) { if (_beneficiaries.isEmpty) {
return Center( return Center(
@@ -86,7 +121,7 @@ class _FundTransferBeneficiaryScreenState
leading: CircleAvatar( leading: CircleAvatar(
radius: 24, radius: 24,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
child: getBankLogo(beneficiary.bankName, context), child: _getBankLogo(beneficiary.bankName),
), ),
title: Text(beneficiary.name), title: Text(beneficiary.name),
subtitle: Column( subtitle: Column(
@@ -109,7 +144,6 @@ class _FundTransferBeneficiaryScreenState
debitAccountNo: widget.creditAccountNo, debitAccountNo: widget.creditAccountNo,
creditBeneficiary: beneficiary, creditBeneficiary: beneficiary,
remitterName: widget.remitterName, remitterName: widget.remitterName,
isOwnBank: widget.isOwnBank,
), ),
), ),
); );

View File

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

View File

@@ -1,8 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:kmobile/api/services/auth_service.dart'; import 'package:kmobile/api/services/auth_service.dart';
import 'package:kmobile/di/injection.dart'; import 'package:kmobile/di/injection.dart';
import 'package:kmobile/features/fund_transfer/screens/tpin_prompt_screen.dart'; import 'package:kmobile/features/fund_transfer/screens/tpin_prompt_screen.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
@@ -15,40 +15,15 @@ class TransactionPinScreen extends StatefulWidget {
State<TransactionPinScreen> createState() => _TransactionPinScreenState(); State<TransactionPinScreen> createState() => _TransactionPinScreenState();
} }
class _TransactionPinScreenState extends State<TransactionPinScreen> class _TransactionPinScreenState extends State<TransactionPinScreen> {
with SingleTickerProviderStateMixin {
final List<String> _pin = []; final List<String> _pin = [];
bool _loading = true; bool _loading = true;
bool _isSubmitting = false; bool _isSubmitting = false;
late final AnimationController _bounceController;
late final Animation<double> _bounceAnimation;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_checkIfTpinIsSet(); _checkIfTpinIsSet();
_bounceController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 150),
);
_bounceAnimation = Tween<double>(begin: 1.0, end: 1.1).animate(
CurvedAnimation(
parent: _bounceController,
curve: Curves.elasticIn,
reverseCurve: Curves.elasticOut),
)..addStatusListener((status) {
if (status == AnimationStatus.completed) {
_bounceController.reverse();
}
});
}
@override
void dispose() {
_bounceController.dispose();
super.dispose();
} }
Future<void> _checkIfTpinIsSet() async { Future<void> _checkIfTpinIsSet() async {
@@ -83,7 +58,6 @@ class _TransactionPinScreenState extends State<TransactionPinScreen>
if (_pin.isNotEmpty) _pin.removeLast(); if (_pin.isNotEmpty) _pin.removeLast();
} else if (_pin.length < 6) { } else if (_pin.length < 6) {
_pin.add(value); _pin.add(value);
_bounceController.forward(from: 0);
} }
}); });
} }
@@ -110,46 +84,29 @@ class _TransactionPinScreenState extends State<TransactionPinScreen>
} }
Widget _buildPinIndicators() { Widget _buildPinIndicators() {
return AnimatedBuilder( return Row(
animation: _bounceAnimation, mainAxisAlignment: MainAxisAlignment.center,
builder: (context, child) { children: List.generate(6, (index) {
return Row( return Container(
mainAxisAlignment: MainAxisAlignment.center, margin: const EdgeInsets.symmetric(horizontal: 8),
children: List.generate(6, (index) { width: 20,
final isAnimating = height: 20,
index == _pin.length - 1 && _bounceController.isAnimating; decoration: BoxDecoration(
return Transform.scale( shape: BoxShape.circle,
scale: isAnimating ? _bounceAnimation.value : 1.0, border: Border.all(color: Theme.of(context).primaryColor, width: 2),
child: Container( color: index < _pin.length
margin: const EdgeInsets.symmetric(horizontal: 8), ? Theme.of(context).primaryColor
width: 30, : Colors.transparent,
height: 30, ),
decoration: BoxDecoration( );
shape: BoxShape.circle, }),
color: index < _pin.length );
? Theme.of(context).colorScheme.onSurfaceVariant
: Theme.of(context)
.colorScheme
.surfaceContainerHighest),
),
);
}),
);
});
} }
Widget _buildKey(String label, {IconData? icon}) { Widget _buildKey(String label, {IconData? icon}) {
return Expanded( return Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () => label == 'done' ? _submitPin() : _onKeyPressed(label),
HapticFeedback.lightImpact();
if (label == 'done') {
_submitPin();
} else {
_onKeyPressed(label);
}
},
borderRadius: BorderRadius.circular(48),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 20), padding: const EdgeInsets.symmetric(vertical: 20),
child: Center( child: Center(
@@ -186,30 +143,37 @@ class _TransactionPinScreenState extends State<TransactionPinScreen>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context).tpin), leading: IconButton(
icon: const Icon(Symbols.arrow_back_ios_new),
onPressed: () {
Navigator.pop(context);
},
),
title: Text(
AppLocalizations.of(context).tpin,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
),
centerTitle: false, centerTitle: false,
), ),
body: _loading body: _loading
? const Center(child: CircularProgressIndicator()) ? const Center(child: CircularProgressIndicator())
: SafeArea( : Padding(
child: Padding( padding: const EdgeInsets.only(bottom: 20.0),
padding: const EdgeInsets.only(bottom: 20.0), child: Column(
child: Column( children: [
children: [ const Spacer(),
const Spacer(), Text(
Text( AppLocalizations.of(context).enterTpin,
AppLocalizations.of(context).enterTpin, style: const TextStyle(fontSize: 18),
style: const TextStyle(fontSize: 18), ),
), const SizedBox(height: 20),
const SizedBox(height: 50), _buildPinIndicators(),
_buildPinIndicators(), const Spacer(),
const Spacer(), _buildKeypad(),
_buildKeypad(), ],
],
),
), ),
), ),
); );
} }
} }

View File

@@ -67,13 +67,13 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
const SizedBox(height: 6), const SizedBox(height: 6),
Text( Text(
"On $transactionDate", "On $transactionDate",
style: TextStyle(fontSize: 14, color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6)), style: const TextStyle(fontSize: 14, color: Colors.black54),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Text( Text(
"${AppLocalizations.of(context).toAccountNumber}: $creditAccount", "${AppLocalizations.of(context).toAccountNumber}: $creditAccount",
style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.onSurface.withOpacity(0.8)), style: const TextStyle(fontSize: 12, color: Colors.black87),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
], ],
@@ -91,15 +91,15 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
child: OutlinedButton.icon( child: OutlinedButton.icon(
onPressed: _shareScreenshot, onPressed: _shareScreenshot,
icon: const Icon(Icons.share, size: 18), icon: const Icon(Icons.share, size: 18),
label: Text(AppLocalizations.of(context).share, label: Text(AppLocalizations.of(context).share),
style: TextStyle(color: Theme.of(context).colorScheme.onPrimaryContainer),
),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
shape: const StadiumBorder(), shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Theme.of(context).primaryColorDark, backgroundColor:
foregroundColor:
Theme.of(context).scaffoldBackgroundColor, Theme.of(context).scaffoldBackgroundColor,
foregroundColor: Theme.of(context).primaryColorLight,
side: const BorderSide(color: Colors.black, width: 1),
elevation: 0,
), ),
), ),
), ),

View File

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

View File

@@ -1,23 +0,0 @@
import 'package:flutter/material.dart';
class LogoutDialog extends StatelessWidget {
const LogoutDialog({super.key});
@override
Widget build(BuildContext context) {
return AlertDialog(
title: const Text("Logout"),
content: const Text("Are you sure you want to logout?"),
actions: [
TextButton(
onPressed: () => Navigator.pop(context, false), // dismiss
child: const Text("No"),
),
TextButton(
onPressed: () => Navigator.pop(context, true), // confirm
child: const Text("Yes"),
),
],
);
}
}

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:kmobile/features/profile/preferences/theme_mode_dialog.dart';
import 'language_dialog.dart'; import 'language_dialog.dart';
import 'color_theme_dialog.dart'; import 'color_theme_dialog.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
@@ -29,7 +28,8 @@ class PreferenceScreen extends StatelessWidget {
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
builder: (_) => const LanguageDialog(), builder: (_) =>
const LanguageDialog(), // your custom language dialog
); );
}, },
), ),
@@ -37,14 +37,19 @@ class PreferenceScreen extends StatelessWidget {
ListTile( ListTile(
leading: const Icon(Icons.brightness_6), leading: const Icon(Icons.brightness_6),
title: Text(AppLocalizations.of(context).themeMode), title: Text(AppLocalizations.of(context).themeMode),
onTap: () { enabled: false,
showThemeModeDialog(context); //trailing: Switch(
}, // value: state.isDarkMode,
// onChanged: (val) {
// context.read<ThemeCubit>().toggleDarkMode(val);
// },
//),
), ),
//Color_Theme_Selection //Color_Theme_Selection
ListTile( ListTile(
leading: const Icon(Icons.color_lens), leading: const Icon(Icons.color_lens),
title: Text(AppLocalizations.of(context).themeColor), title: Text(AppLocalizations.of(context).themeColor),
//enabled: false,
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,

View File

@@ -1,33 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:kmobile/features/auth/controllers/theme_mode_cubit.dart';
Future<void> showThemeModeDialog(BuildContext context) async {
final cubit = context.read<ThemeModeCubit>();
final currentMode = context.read<ThemeModeCubit>().state.mode;
await showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: const Text("Select Theme Mode"),
content: Column(
mainAxisSize: MainAxisSize.min,
children: ThemeMode.values.map((mode) {
return RadioListTile<ThemeMode>(
title: Text(mode.toString().split('.').last.toUpperCase()),
value: mode,
groupValue: currentMode,
onChanged: (value) {
if (value != null) {
cubit.changeThemeMode(value);
Navigator.pop(context);
}
},
);
}).toList(),
),
);
},
);
}

View File

@@ -1,23 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:kmobile/data/repositories/auth_repository.dart';
import 'package:kmobile/features/profile/preferences/logout_dialog.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../di/injection.dart';
import '../../l10n/app_localizations.dart'; import '../../l10n/app_localizations.dart';
import 'package:kmobile/features/profile/preferences/preference_screen.dart'; import 'package:kmobile/features/profile/preferences/preference_screen.dart';
class ProfileScreen extends StatelessWidget { class ProfileScreen extends StatelessWidget {
const ProfileScreen({super.key}); const ProfileScreen({super.key});
Future<void> _handleLogout(BuildContext context) async {
final auth = getIt<AuthRepository>();
final prefs = await SharedPreferences.getInstance();
await prefs.clear(); // clear saved session/token
await auth.clearAuthTokens();
// Navigate to login and remove all previous routes
Navigator.pushNamedAndRemoveUntil(context, '/login', (route) => false);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -31,7 +17,7 @@ class ProfileScreen extends StatelessWidget {
children: [ children: [
ListTile( ListTile(
leading: const Icon(Icons.settings), leading: const Icon(Icons.settings),
title: Text(loc.preferences), title: Text(loc.preferences), // Localized "Preferences"
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@@ -41,20 +27,6 @@ class ProfileScreen extends StatelessWidget {
}, },
), ),
// You can add more profile options here later // You can add more profile options here later
ListTile(
leading: const Icon(Icons.logout),
title: const Text("Logout"),
onTap: () async {
final shouldLogout = await showDialog<bool>(
context: context,
builder: (_) => const LogoutDialog(),
);
if (shouldLogout == true) {
await _handleLogout(context);
}
},
),
], ],
), ),
); );

View File

@@ -1,11 +1,7 @@
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/neft_service.dart'; import 'package:kmobile/api/services/neft_service.dart';
import 'package:kmobile/api/services/rtgs_service.dart'; import 'package:kmobile/api/services/rtgs_service.dart';
import 'package:kmobile/data/models/imps_transaction.dart';
import 'package:kmobile/data/models/neft_transaction.dart'; import 'package:kmobile/data/models/neft_transaction.dart';
import 'package:kmobile/data/models/payment_response.dart'; import 'package:kmobile/data/models/payment_response.dart';
import 'package:kmobile/data/models/rtgs_transaction.dart'; import 'package:kmobile/data/models/rtgs_transaction.dart';
@@ -13,7 +9,9 @@ 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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter_swipe_button/flutter_swipe_button.dart'; import 'package:flutter_swipe_button/flutter_swipe_button.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../../di/injection.dart'; import '../../../../di/injection.dart';
import '../../../../api/services/beneficiary_service.dart'; import '../../../../api/services/beneficiary_service.dart';
@@ -50,7 +48,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() { setState(() {
accountType = 'Savings'; accountType = AppLocalizations.of(context).savings;
}); });
}); });
} }
@@ -120,7 +118,6 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
return [ return [
AppLocalizations.of(context).neft, AppLocalizations.of(context).neft,
AppLocalizations.of(context).rtgs, AppLocalizations.of(context).rtgs,
AppLocalizations.of(context).imps,
]; ];
} }
@@ -154,8 +151,6 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
final amount = double.tryParse(amountController.text) ?? 0; final amount = double.tryParse(amountController.text) ?? 0;
final selectedMode = transactionModes(context)[selectedTransactionIndex]; final selectedMode = transactionModes(context)[selectedTransactionIndex];
final isRtgs = selectedMode == AppLocalizations.of(context).rtgs; final isRtgs = selectedMode == AppLocalizations.of(context).rtgs;
final isNeft = selectedMode == AppLocalizations.of(context).neft;
final isImps = selectedMode == AppLocalizations.of(context).imps;
if (isRtgs && amount < 200000) { if (isRtgs && amount < 200000) {
showDialog( showDialog(
@@ -179,14 +174,14 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => TransactionPinScreen( builder: (context) => TransactionPinScreen(
onPinCompleted: (pinScreenContext, tpin) async { onPinCompleted: (pinScreenContext, tpin) async {
if (isNeft) { if (!isRtgs) {
// NEFT // NEFT
final neftTx = NeftTransaction( final neftTx = NeftTransaction(
fromAccount: widget.debitAccount, fromAccount: widget.debitAccount,
toAccount: accountNumberController.text, toAccount: accountNumberController.text,
amount: amountController.text, amount: amountController.text,
ifscCode: ifscController.text, ifscCode: ifscController.text,
remitterName: "Unknown", remitterName: "Unknown", // TODO: Get actual remitter name
beneficiaryName: nameController.text, beneficiaryName: nameController.text,
tpin: tpin, tpin: tpin,
); );
@@ -212,29 +207,6 @@ 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,
@@ -242,83 +214,20 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
); );
completer.complete(paymentResponse); completer.complete(paymentResponse);
} }
} } else {
if (isImps) {
// IMPS
final impsTx = ImpsTransaction(
fromAccount: widget.debitAccount,
toAccount: accountNumberController.text,
amount: amountController.text,
ifscCode: ifscController.text,
remitterName: "Unknown",
beneficiaryName: nameController.text,
tpin: tpin,
);
final impsService = getIt<ImpsService>();
final completer = Completer<PaymentResponse>();
if (!pinScreenContext.mounted) {
return;
}
Navigator.of(pinScreenContext).pushReplacement(
MaterialPageRoute(
builder: (_) => PaymentAnimationScreen(
paymentResponse: completer.future),
),
);
try {
final impsResponse =
await impsService.processImpsTransaction(impsTx);
final paymentResponse = PaymentResponse(
isSuccess: impsResponse.message.toUpperCase() == 'SUCCESS',
date: DateTime.now(),
creditedAccount: impsTx.toAccount,
amount: impsTx.amount,
currency: 'INR',
utr: impsResponse.utr,
);
completer.complete(paymentResponse);
} 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);
} catch (e) {
final paymentResponse = PaymentResponse(
isSuccess: false,
errorMessage: e.toString(),
);
completer.complete(paymentResponse);
}
}
if (isRtgs) {
// RTGS // RTGS
final rtgsTx = RtgsTransaction( final rtgsTx = RtgsTransaction(
fromAccount: widget.debitAccount, fromAccount: widget.debitAccount,
toAccount: accountNumberController.text, toAccount: accountNumberController.text,
amount: amountController.text, amount: amountController.text,
ifscCode: ifscController.text, ifscCode: ifscController.text,
remitterName: "Unknown", remitterName: "Unknown", // TODO: Get actual remitter name
beneficiaryName: nameController.text, beneficiaryName: nameController.text,
tpin: tpin, tpin: tpin,
); );
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(
@@ -338,22 +247,6 @@ 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,
@@ -373,10 +266,33 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
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).quickPayOutsideBank, AppLocalizations.of(context).quickPayOutsideBank,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, 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: Padding( body: Padding(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
@@ -410,13 +326,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary, width: 2),
), ),
), ),
controller: accountNumberController, controller: accountNumberController,
@@ -448,13 +362,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary, width: 2),
), ),
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
@@ -471,7 +383,6 @@ 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(
@@ -485,14 +396,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary,
width: 2),
), ),
), ),
controller: ifscController, controller: ifscController,
@@ -523,9 +431,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
}, },
), ),
), ),
const SizedBox( const SizedBox(width: 10),
width: 10,
),
Expanded( Expanded(
child: DropdownButtonFormField<String>( child: DropdownButtonFormField<String>(
value: accountType, value: accountType,
@@ -535,19 +441,16 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary,
width: 2),
), ),
), ),
items: [ items: [
'Savings', AppLocalizations.of(context).savings,
'Current', AppLocalizations.of(context).current,
] ]
.map( .map(
(e) => DropdownMenuItem(value: e, child: Text(e)), (e) => DropdownMenuItem(value: e, child: Text(e)),
@@ -570,13 +473,14 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).dialogBackgroundColor, fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary, width: 2), color: Colors.black,
width: 2,
),
), ),
), ),
), ),
@@ -590,13 +494,12 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).dialogBackgroundColor, fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context).colorScheme.primary, color: Colors.black,
width: 2, width: 2,
), ),
), ),
@@ -639,8 +542,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
padding: const EdgeInsets.only(bottom: 24.0), padding: const EdgeInsets.only(bottom: 24.0),
child: Text( child: Text(
_validationError!, _validationError!,
style: style: const TextStyle(color: Colors.red),
TextStyle(color: Theme.of(context).colorScheme.error),
), ),
), ),
TextFormField( TextFormField(
@@ -652,13 +554,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).dialogBackgroundColor, fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary, width: 2),
), ),
), ),
validator: (value) { validator: (value) {
@@ -682,14 +582,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary,
width: 2),
), ),
), ),
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
@@ -707,14 +604,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary,
width: 2),
), ),
), ),
controller: amountController, controller: amountController,
@@ -751,7 +645,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
child: SwipeButton.expand( child: SwipeButton.expand(
thumb: Icon(Icons.arrow_forward, thumb: Icon(Icons.arrow_forward,
color: Theme.of(context).dialogBackgroundColor), color: Theme.of(context).dialogBackgroundColor),
activeThumbColor: Theme.of(context).colorScheme.primary, activeThumbColor: Theme.of(context).primaryColor,
activeTrackColor: activeTrackColor:
Theme.of(context).colorScheme.secondary.withAlpha(100), Theme.of(context).colorScheme.secondary.withAlpha(100),
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
@@ -787,12 +681,12 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
padding: const EdgeInsets.symmetric(vertical: 5), padding: const EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isSelected color: isSelected
? Theme.of(context).colorScheme.primary ? Theme.of(context).primaryColor
: Theme.of(context).scaffoldBackgroundColor, : Theme.of(context).scaffoldBackgroundColor,
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
border: Border.all( border: Border.all(
color: isSelected color: isSelected
? Theme.of(context).colorScheme.primary ? Theme.of(context).primaryColor
: Theme.of(context).scaffoldBackgroundColor, : Theme.of(context).scaffoldBackgroundColor,
width: isSelected ? 0 : 1.2, width: isSelected ? 0 : 1.2,
), ),
@@ -800,8 +694,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
transactionModes(context)[index], transactionModes(context)[index],
style: style: const TextStyle(color: Colors.black),
TextStyle(color: Theme.of(context).colorScheme.onSurface),
), ),
), ),
), ),

View File

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

View File

@@ -1,11 +1,13 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter_swipe_button/flutter_swipe_button.dart'; import 'package:flutter_swipe_button/flutter_swipe_button.dart';
import 'package:kmobile/api/services/beneficiary_service.dart'; import 'package:kmobile/api/services/beneficiary_service.dart';
import 'package:kmobile/api/services/payment_service.dart'; import 'package:kmobile/api/services/payment_service.dart';
import 'package:kmobile/data/models/transfer.dart'; import 'package:kmobile/data/models/transfer.dart';
import 'package:kmobile/di/injection.dart'; 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:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
import '../../fund_transfer/screens/transaction_pin_screen.dart'; import '../../fund_transfer/screens/transaction_pin_screen.dart';
@@ -88,13 +90,33 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
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).quickPayOwnBank, AppLocalizations.of(context).quickPayOwnBank,
style: TextStyle( style:
color: Theme.of(context).colorScheme.onSurface, const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
fontWeight: FontWeight.w500),
), ),
centerTitle: false, 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: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
@@ -125,13 +147,11 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary, width: 2),
), ),
), ),
controller: accountNumberController, controller: accountNumberController,
@@ -157,13 +177,11 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary, width: 2),
), ),
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
@@ -243,13 +261,11 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary, width: 2),
), ),
), ),
value: _selectedAccountType, value: _selectedAccountType,
@@ -283,13 +299,11 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).scaffoldBackgroundColor, fillColor: Theme.of(context).scaffoldBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black),
color: Theme.of(context).colorScheme.outline),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary, width: 2),
), ),
), ),
controller: amountController, controller: amountController,
@@ -312,7 +326,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
child: SwipeButton.expand( child: SwipeButton.expand(
thumb: Icon(Icons.arrow_forward, thumb: Icon(Icons.arrow_forward,
color: Theme.of(context).dialogBackgroundColor), color: Theme.of(context).dialogBackgroundColor),
activeThumbColor: Theme.of(context).colorScheme.primary, activeThumbColor: Theme.of(context).primaryColor,
activeTrackColor: Theme.of( activeTrackColor: Theme.of(
context, context,
).colorScheme.secondary.withAlpha(100), ).colorScheme.secondary.withAlpha(100),
@@ -386,12 +400,11 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
isDense: true, isDense: true,
filled: true, filled: true,
fillColor: Theme.of(context).dialogBackgroundColor, fillColor: Theme.of(context).dialogBackgroundColor,
enabledBorder: OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).colorScheme.outline), borderSide: BorderSide(color: Colors.black),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(color: Colors.black, width: 2),
color: Theme.of(context).colorScheme.primary, width: 2),
), ),
), ),
); );

View File

@@ -1,35 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:lottie/lottie.dart';
class SecurityErrorScreen extends StatelessWidget {
final String message;
const SecurityErrorScreen({Key? key, required this.message}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Lottie.asset('assets/animations/error.json', height: 200),
const SizedBox(height: 20),
Text(
message,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
),
const SizedBox(height: 40),
ElevatedButton(
onPressed: () => SystemChannels.platform.invokeMethod('SystemNavigator.pop'),
child: const Text('Okay'),
),
],
),
),
);
}
}

View File

@@ -1,163 +0,0 @@
import '../../../l10n/app_localizations.dart';
import 'package:flutter/material.dart';
class Branch {
final String name;
final String code;
final String ifsc;
final String address;
Branch({
required this.name,
required this.code,
required this.ifsc,
required this.address,
});
}
class BranchLocatorScreen extends StatefulWidget {
const BranchLocatorScreen({super.key});
@override
State<BranchLocatorScreen> createState() => _BranchLocatorScreenState();
}
class _BranchLocatorScreenState extends State<BranchLocatorScreen> {
final TextEditingController _searchController = TextEditingController();
// Static list of 5 branches
final List<Branch> _branches = [
Branch(
name: "Dharamsala - Head Office",
code: "002",
ifsc: "KACE0000002",
address: "Civil Lines Dharmashala, Kangra, HP - 176215"),
Branch(
name: "Kangra",
code: "033",
ifsc: "KACE0000033",
address: "Rajput Bhawankangrapo Kangra, Kangra, HP "),
];
List<Branch> _filteredBranches = [];
@override
void initState() {
super.initState();
_filteredBranches = _branches; // Initially show all branches
}
void _filterBranches(String query) {
setState(() {
if (query.isEmpty) {
_filteredBranches = _branches;
} else {
_filteredBranches = _branches.where((branch) {
final lowerQuery = query.toLowerCase();
return branch.name.toLowerCase().contains(lowerQuery) ||
branch.code.toLowerCase().contains(lowerQuery) ||
branch.ifsc.toLowerCase().contains(lowerQuery) ||
branch.address.toLowerCase().contains(lowerQuery);
}).toList();
}
});
}
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// appBar: AppBar(
// title: Text(AppLocalizations.of(context).branchLocator),
// ),
// body: Center(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Icon(
// Icons.location_on,
// size: 80,
// color: Theme.of(context).primaryColor,
// ),
// const SizedBox(height: 16),
// Text(
// AppLocalizations.of(context).findnearbybranched,
// style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
// ),
// const SizedBox(height: 24),
// ElevatedButton.icon(
// icon: const Icon(Icons.search),
// label: Text( AppLocalizations.of(context).searchbranch),
// onPressed: () {
// // Place API here
// // ScaffoldMessenger.of(context).showSnackBar(
// // SnackBar(content: Text( AppLocalizations.of(context).branchsearchsoon)),
// // );
// },
// ),
// ],
// ),
// ),
// );
// }
// }
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context).branchLocator),
),
body: Column(
children: [
// Search bar
Padding(
padding: const EdgeInsets.all(12.0),
child: TextField(
controller: _searchController,
onChanged: _filterBranches,
decoration: InputDecoration(
hintText: AppLocalizations.of(context).searchbranchby,
prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
),
// List of branches
Expanded(
child: _filteredBranches.isEmpty
? const Center(child: Text("No matching branches found"))
: ListView.builder(
itemCount: _filteredBranches.length,
itemBuilder: (context, index) {
final branch = _filteredBranches[index];
return Card(
margin: const EdgeInsets.symmetric(
horizontal: 12, vertical: 6),
child: ListTile(
leading: Icon(Icons.location_city,
color: Theme.of(context).primaryColor),
title: Text(branch.name,
style:
const TextStyle(fontWeight: FontWeight.bold)),
subtitle: Text(
"Code: ${branch.code} | IFSC: ${branch.ifsc} \nBranch Address: ${branch.address}"),
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text("Selected ${branch.name}")),
);
},
),
);
},
),
),
],
),
);
}
}

View File

@@ -1,5 +1,3 @@
import 'package:kmobile/features/service/screens/branch_locator_screen.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -20,8 +18,34 @@ class _ServiceScreen extends State<ServiceScreen> {
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
title: Text( title: Text(
AppLocalizations.of(context).services, AppLocalizations.of(context).services,
style:
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
), ),
centerTitle: false, centerTitle: false,
actions: [
// IconButton(
// icon: const Icon(Icons.notifications_outlined),
// onPressed: () {
// // Navigate to notifications
// },
// ),
Padding(
padding: const EdgeInsets.only(right: 10.0),
child: InkWell(
borderRadius: BorderRadius.circular(20),
onTap: () {
// Navigator.push(context, MaterialPageRoute(
// builder: (context) => const CustomerInfoScreen()));
},
child: const CircleAvatar(
backgroundImage: AssetImage(
'assets/images/avatar.jpg',
), // Replace with your image
radius: 20,
),
),
),
],
), ),
body: ListView( body: ListView(
children: [ children: [
@@ -46,12 +70,7 @@ class _ServiceScreen extends State<ServiceScreen> {
ServiceManagementTile( ServiceManagementTile(
icon: Symbols.missing_controller, icon: Symbols.missing_controller,
label: AppLocalizations.of(context).branchLocator, label: AppLocalizations.of(context).branchLocator,
onTap: () { onTap: () {},
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const BranchLocatorScreen()));
},
), ),
const Divider(height: 1), const Divider(height: 1),
], ],

View File

@@ -25,10 +25,10 @@
"hi": "Hi", "hi": "Hi",
"kMobile": "kMobile", "kMobile": "kMobile",
"scanBiometric": "Scan to enable Biometric login", "scanBiometric": "Scan to enable Biometric login",
"savingsAccount": "Savings", "savingsAccount": "Savings Account",
"loanAccount": "Loan", "loanAccount": "Loan Account",
"termDeposit": "Term Deposit", "termDeposit": "Term Deposit Account",
"recurringDeposit": "Recurring Deposit", "recurringDeposit": "Recurring Deposit Account",
"unknownAccount": "Unknown Account Type", "unknownAccount": "Unknown Account Type",
"customerInfo": "Customer \n Info", "customerInfo": "Customer \n Info",
"fundTransfer": "Fund \n Transfer", "fundTransfer": "Fund \n Transfer",
@@ -109,8 +109,9 @@
"gmNorth": "General Manager (North)", "gmNorth": "General Manager (North)",
"enquiry": "Enquiry", "enquiry": "Enquiry",
"fundTransferBeneficiary": "Fund Transfer - Beneficiary", "fundTransferBeneficiary": "Fund Transfer - Beneficiary",
"fundTransfer": "Fund Transfer",
"enterAmount": "Enter Amount", "enterAmount": "Enter Amount",
"accountInfo": "Account \n Info", "accountInfo": "Account Info",
"customerNumber": "Customer Number", "customerNumber": "Customer Number",
"productName": "Product Name", "productName": "Product Name",
"accountStatus": "Account Status", "accountStatus": "Account Status",
@@ -240,54 +241,11 @@
"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": "Credit To", "creditedTo": "Credited 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",
"accno7to20": "Account number must be between 7 and 20 digits", "accno7to20": "Account number must be between 7 and 20 digits",
"validateBeneficiaryproceeding": "Please validate beneficiary before proceeding", "validateBeneficiaryproceeding": "Please validate beneficiary before proceeding"
"findnearbybranched": "Find nearby branches",
"searchbranch": "Search Branch",
"searchbranchby": "Search by Branch Name / Code / IFSC",
"branchsearchsoon": "Branch search coming soon...",
"loginFailed": "Login failed",
"invalidCredentials": "Invalid credentials",
"networkErrorDuringLogin": "Network error during login",
"unexpectedErrorDuringLogin": "Unexpected error during login",
"tokenRefreshFailed": "Token refresh failed",
"failedToRefreshToken": "Failed to refresh token",
"failedToCheckTpinStatus": "Failed to check TPIN status",
"networkErrorDuringTpinCheck": "Network error during TPIN check",
"unexpectedErrorDuringTpinCheck": "Unexpected error during TPIN check",
"failedToSetTpin": "Failed to set TPIN",
"networkErrorDuringTpinSetup": "Network error during TPIN setup",
"unexpectedErrorDuringTpinSetup": "Unexpected error during TPIN setup",
"failedToValidateBeneficiary": "Failed to validate beneficiary",
"networkError": "Network error",
"unexpectedError": "Unexpected error: ",
"invalidIfscCode": "INVALID IFSC CODE",
"invalidBeneficiaryDetails": "Invalid Beneficiary Details",
"failedToFetchBeneficiaries": "Failed to fetch beneficiaries",
"failedToDeleteBeneficiary": "Failed to delete beneficiary",
"impsTransactionFailedWithStatusCode": "IMPS transaction failed with status code: ",
"anUnexpectedErrorOccurred": "An unexpected error occurred: ",
"neftTransactionFailedWithStatusCode": "NEFT transaction failed with status code: ",
"unknownError": "Unknown error",
"failedToProcessQuickPayWithinBank": "Failed to process quick pay within bank: ",
"rtgsTransactionFailedWithStatusCode": "RTGS transaction failed with status code: ",
"failedToLoadCustomerDetails": "Failed to load customer details",
"routeNotFound": "Route not found!",
"pleaseValidateBeneficiaryDetailsFirst": "Please validate beneficiary details first.",
"beneficiaryAlreadyExists": "Beneficiary already exists",
"pleaseEnterAValidAndMatchingAccountNumber": "Please enter a valid and matching account number.",
"beneficiaryDeletedSuccessfully": "Beneficiary deleted successfully",
"areYouSureYouWantToDeleteThisBeneficiary": "Are you sure you want to delete this beneficiary?",
"yourAccountDoesNotHaveSufficientBalance": "Your account does not have sufficient balance",
"green": "Green",
"orange": "Orange",
"deleteBeneficiary": "Delete Beneficiary",
"beneficiarydetails": "Beneficiary Details",
"delete": "Delete",
"search": "Search",
"viewCardDeatils": "View Card Details"
} }

View File

@@ -241,54 +241,10 @@
"invalidRtgsPopUp": "RTGS लेनदेन के लिए न्यूनतम 2,00,000 रुपये की राशि की आवश्यकता होती है। कृपया अधिक राशि दर्ज करें या लेनदेन मोड के रूप में NEFT चुनें", "invalidRtgsPopUp": "RTGS लेनदेन के लिए न्यूनतम 2,00,000 रुपये की राशि की आवश्यकता होती है। कृपया अधिक राशि दर्ज करें या लेनदेन मोड के रूप में NEFT चुनें",
"correctTpin": "कृपया सही टी-पिन दर्ज करें", "correctTpin": "कृपया सही टी-पिन दर्ज करें",
"insufficientFund": "आपके खाते में पर्याप्त शेष राशि नहीं है", "insufficientFund": "आपके खाते में पर्याप्त शेष राशि नहीं है",
"creditedTo": "को श्रेय", "creditedTo": "को श्रेय दिया गया",
"selectTransactionType": "लेन-देन का प्रकार चुनें", "selectTransactionType": "लेन-देन का प्रकार चुनें",
"proceed": "आगे बढ़ना", "proceed": "आगे बढ़ना",
"plsValidateBeneficiary": "कृपया पहले लाभार्थी विवरण सत्यापित करें", "plsValidateBeneficiary": "कृपया पहले लाभार्थी विवरण सत्यापित करें",
"accno7to20": "खाता संख्या सात से बीस अंकों के बीच होनी चाहिए", "accno7to20": "खाता संख्या सात से बीस अंकों के बीच होनी चाहिए",
"validateBeneficiaryproceeding": "कृपया आगे बढ़ने से पहले लाभार्थी को पट्टे पर मान्य करें", "validateBeneficiaryproceeding": "कृपया आगे बढ़ने से पहले लाभार्थी को पट्टे पर मान्य करें"
"findnearbybranched": "आस-पास की शाखाएँ खोजें",
"searchbranch": "शाखा खोजें",
"searchbranchby": "शाखा खोजें नाम / बैंक कोड / आईएफएससी द्वारा",
"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": "कार्ड विवरण देखें"
} }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,724 @@
import 'app_localizations.dart';
// ignore_for_file: type=lint
/// The translations for English (`en`).
class AppLocalizationsEn extends AppLocalizations {
AppLocalizationsEn([String locale = 'en']) : super(locale);
@override
String get profile => 'Profile';
@override
String get preferences => 'Preferences';
@override
String get language => 'Language';
@override
String get selectLanguage => 'Select Language';
@override
String get english => 'English';
@override
String get hindi => 'Hindi';
@override
String get cancel => 'Cancel';
@override
String get home => 'Home';
@override
String get card => 'Card';
@override
String get services => 'Services';
@override
String get quickPay => 'Quick \n Pay';
@override
String get quickLinks => 'Quick Links';
@override
String get recentTransactions => 'Recent Transactions';
@override
String get accountNumber => 'Account Number';
@override
String get enableBiometric => 'Enable Biometric Authentication';
@override
String get useBiometricPrompt => 'Use fingerprint/face ID for faster login?';
@override
String get later => 'Later';
@override
String get enable => 'Enable';
@override
String get noTransactions => 'No transactions found for this account.';
@override
String get somethingWentWrong => 'Something went wrong';
@override
String failedToLoad(Object error) {
return 'Failed to load transactions: $error';
}
@override
String get failedToRefresh => 'Failed to refresh data';
@override
String get hi => 'Hi';
@override
String get kMobile => 'kMobile';
@override
String get scanBiometric => 'Scan to enable Biometric login';
@override
String get savingsAccount => 'Savings Account';
@override
String get loanAccount => 'Loan Account';
@override
String get termDeposit => 'Term Deposit Account';
@override
String get recurringDeposit => 'Recurring Deposit Account';
@override
String get unknownAccount => 'Unknown Account Type';
@override
String get customerInfo => 'Customer \n Info';
@override
String get fundTransfer => 'Fund Transfer';
@override
String get accountInfo => 'Account Info';
@override
String get accountStatement => 'Account Statement';
@override
String get handleCheque => 'Handle \n Cheque';
@override
String get manageBeneficiary => 'Manage \n Beneficiary';
@override
String get contactUs => 'Contact \n Us';
@override
String get addBeneficiary => 'Add Beneficiary';
@override
String get confirmAccountNumber => 'Confirm Account Number';
@override
String get name => 'Name';
@override
String get ifscCode => 'IFSC Code';
@override
String get bankName => 'Beneficiary Bank Name';
@override
String get branchName => 'Branch Name';
@override
String get accountType => 'Account Type';
@override
String get savings => 'Savings';
@override
String get current => 'Current';
@override
String get phone => 'Phone';
@override
String get validateAndAdd => 'Validate and Add';
@override
String get beneficiaryAdded => 'Beneficiary Added Successfully';
@override
String get invalidIfscFormat => 'Invalid IFSC Format';
@override
String get noIfscDetails => 'No details found for IFSC';
@override
String get enterValidAccountNumber => 'Enter a valid account number';
@override
String get reenterAccountNumber => 'Re-enter Account Number';
@override
String get accountMismatch => 'Account Numbers do not match';
@override
String get nameRequired => 'Name is required';
@override
String get enterIfsc => 'Enter IFSC code';
@override
String get enterValidPhone => 'Enter a valid phone number';
@override
String get payNow => 'Pay Now';
@override
String get beneficiaries => 'Beneficiaries';
@override
String get cif => 'CIF';
@override
String get activeAccounts => 'Number of Active Accounts';
@override
String get mobileNumber => 'Mobile Number';
@override
String get dateOfBirth => 'Date of Birth';
@override
String get branchCode => 'Branch Code';
@override
String get branchAddress => 'Branch Address';
@override
String get primaryId => 'Primary ID';
@override
String get quickPayOwnBank => 'Quick Pay - Own Bank';
@override
String get debitAccountNumber => 'Debit Account Number';
@override
String get accountNumberRequired => 'Account Number is required';
@override
String get validAccountNumber => 'Enter a valid account number';
@override
String get beneficiaryAccountType => 'Beneficiary Account Type';
@override
String get loan => 'Loan';
@override
String get selectAccountType => 'Please select account type';
@override
String get amount => 'Amount';
@override
String get amountRequired => 'Amount is required';
@override
String get validAmount => 'Enter a valid amount';
@override
String get swipeToPay => 'Swipe to Pay';
@override
String get outsideBank => 'Outside Bank';
@override
String get ownBank => 'Own Bank';
@override
String get neft => 'NEFT';
@override
String get rtgs => 'RTGS';
@override
String get imps => 'IMPS';
@override
String get quickPayOutsideBank => 'Quick Pay - Outside Bank';
@override
String get debitFrom => 'Debit from';
@override
String get bankNameRequired => 'Beneficiary Bank name is required';
@override
String get branchNameRequired => 'Beneficiary Branch Name is required';
@override
String get ifscRequired => 'IFSC Code is required';
@override
String get phoneRequired => 'Phone number is required';
@override
String get transactionMode => 'Transaction Mode';
@override
String get payingVia => 'Paying via';
@override
String get accountOpeningDeposit => 'Account Opening Request - Deposit';
@override
String get accountOpeningLoan => 'Account Opening Request - Loan';
@override
String get branchLocator => 'Branch Locator';
@override
String get emailLaunchError => 'Could not launch email client for';
@override
String get dialerLaunchError => 'Could not launch dialer for';
@override
String get writeToUs => 'Write to us';
@override
String get keyContacts => 'Key Contacts';
@override
String get chairman => 'Chairman';
@override
String get managingDirector => 'Managing Director';
@override
String get gmWest => 'General Manager (West)';
@override
String get gmNorth => 'General Manager (North)';
@override
String get enquiry => 'Enquiry';
@override
String get fundTransferBeneficiary => 'Fund Transfer - Beneficiary';
@override
String get enterAmount => 'Enter Amount';
@override
String get customerNumber => 'Customer Number';
@override
String get productName => 'Product Name';
@override
String get accountStatus => 'Account Status';
@override
String get availableBalance => 'Available Balance';
@override
String get currentBalance => 'Current Balance';
@override
String get filters => 'Filters';
@override
String get fromDate => 'From Date';
@override
String get toDate => 'To Date';
@override
String get minAmount => 'Min Amount';
@override
String get maxAmount => 'Max amount';
@override
String get lastTenTransactions => 'Showing last 10 transactions';
@override
String get applyDebitCard => 'Apply Debit Card';
@override
String get blockUnblockCard => 'Block / Unblock Card';
@override
String get changeCardPin => 'Change Card PIN';
@override
String get cardNumber => 'Card Number';
@override
String get cvv => 'CVV';
@override
String get expiryDate => 'Expiry Date';
@override
String get next => 'Next';
@override
String get block => 'Block';
@override
String get approvedAmount => 'Approved Amount';
@override
String get failedToLoadTransactions => 'Failed to load transactions';
@override
String get pleaseSelectDateFirst => 'Please select date first';
@override
String get cardBlocked => 'Card has been blocked';
@override
String get blockCard => 'Block Card';
@override
String get enterValidCardNumber => 'Enter valid card number';
@override
String get cvv3Digits => 'CVV must be 3 digits';
@override
String get selectExpiryDate => 'Select expiry date';
@override
String get cardManagement => 'Card Management';
@override
String get paymentResult => 'Payment Result';
@override
String get failedToShareScreenshot => 'Failed to share screenshot';
@override
String get paymentSuccessful => 'Payment successful';
@override
String get cardDetails => 'Card Details';
@override
String get cardPin => 'Card PIN';
@override
String get amountEntered => 'Amount entered';
@override
String get enterNewPin => 'Enter new PIN';
@override
String get pleaseEnterNewPin => 'Please enter new PIN';
@override
String get pin4Digits => 'PIN must be at least 4 digits';
@override
String get enterAgain => 'Enter Again';
@override
String get pinsDoNotMatch => 'PINs do not match. Try again.';
@override
String get submit => 'Submit';
@override
String get chequeManagement => 'Cheque Management';
@override
String get requestChequeBook => 'Request Chequebook';
@override
String get chequeDeposit => 'Cheque Deposit';
@override
String get stopCheque => 'Stop Cheque';
@override
String get revokeStop => 'Revoke Stop';
@override
String get positivePay => 'Positive Pay';
@override
String get pinSetSuccess => 'PIN set successfully';
@override
String get creditedAccount => 'Credited Account';
@override
String get date => 'Date';
@override
String get paymentFailed => 'Payment Failed';
@override
String get share => 'Share';
@override
String get done => 'Done';
@override
String get invalidOtp => 'Invalid OTP';
@override
String get enterOtp => 'Enter OTP';
@override
String get otpVerification => 'OTP Verification';
@override
String get otpSentMessage =>
'Enter the 4-digit OTP sent to your mobile number';
@override
String get verifyOtp => 'Verify OTP';
@override
String get otpResent => 'OTP Resent';
@override
String get resendOtp => 'Resend OTP';
@override
String get setTpin => 'Set TPIN';
@override
String get tpinRequired => 'TPIN Required';
@override
String get tpinRequiredMessage =>
'You need to set your TPIN to continue with secure transactions';
@override
String get setTpinTitle => 'Set TPIN';
@override
String get tpinInfo =>
'Your TPIN is a 6-digit code used to authorize transactions. Keep it safe and do not share it with anyone.';
@override
String get tpinFailed => 'Failed to set TPIN. Please try again.';
@override
String get success => 'Success!';
@override
String get tpinSetSuccess => 'Your TPIN was set successfully';
@override
String get ok => 'OK';
@override
String get pinsMismatchRetry => 'PINs do not match. Try again.';
@override
String get pleaseEnter6Digits => 'Please enter 6 digits';
@override
String get setNewTpin => 'Set your new TPIN';
@override
String get confirmNewTpin => 'Confirm your new TPIN';
@override
String get tpinStatusFailed => 'Failed to check TPIN status';
@override
String get enter6DigitTpin => 'Please enter a 6-digit TPIN';
@override
String get tpin => 'TPIN';
@override
String get enterTpin => 'Enter your TPIN';
@override
String get transactionSuccess => 'Transaction Successful';
@override
String get on => 'On';
@override
String get toAccountNumber => 'To Account Number';
@override
String get shareText => 'Share';
@override
String get enableFingerprintLogin => 'Enable Fingerprint Login?';
@override
String get enableFingerprintMessage =>
'Would you like to enable fingerprint authentication for faster login?';
@override
String get no => 'No';
@override
String get yes => 'Yes';
@override
String get authenticateToEnable => 'Authenticate to enable fingerprint login';
@override
String get exitApp => 'Exit App';
@override
String get exitConfirmation => 'Do you really want to exit?';
@override
String get loading => 'Loading......';
@override
String get enableFingerprintQuick =>
'Enable fingerprint authentication for quick login?';
@override
String get kccb => 'KCCB';
@override
String get password => 'Password';
@override
String get pleaseEnterUsername => 'Please enter your username';
@override
String get pleaseEnterPassword => 'Please enter your password';
@override
String get login => 'Login';
@override
String get or => 'OR';
@override
String get register => 'Register';
@override
String get authenticateToAccess => 'Authenticate to access kmobile';
@override
String get incorrectMPIN => 'Incorrect mPIN. Try again.';
@override
String get pleaseEnter4Digits => 'Please enter 4 digits.';
@override
String get enterMPIN => 'Enter your mPIN';
@override
String get setMPIN => 'Set your mPIN';
@override
String get confirmMPIN => 'Confirm your mPIN';
@override
String get kconnect => 'Kconnect';
@override
String get kccBankFull => 'Kangra Central Co-operative Bank';
@override
String get themeColor => 'Theme Color';
@override
String get selectThemeColor => 'Select Theme Color';
@override
String get violet => 'Violet';
@override
String get blue => 'Blue';
@override
String get invalidIfsc => 'Invalid IFSC code';
@override
String get validIfsc => 'Valid IFSC';
@override
String get beneficiaryAddedSuccess => 'Beneficiary Added Successfully';
@override
String get beneficiaryAdditionFailed => 'Beneficiary Addition Failed';
@override
String get noBeneficiaryFound => 'No beneficiaries found';
@override
String get beneficiaryName => 'Beneficiary Name';
@override
String get validateBeneficiary => 'Validate Beneficiary';
@override
String get themeMode => 'Theme Mode';
@override
String get transactionDetails => 'Transaction Details';
@override
String get transactionType => 'Transaction Type';
@override
String get transferType => 'Transfer Type';
@override
String get utrNo => 'UTR No.';
@override
String get beneficiaryAccountNo => 'Beneficiary Account No.';
@override
String get invalidRtgs => 'Invalid Amount for RTGS';
@override
String get invalidRtgsPopUp =>
'RTGS transactions require a minimum amount of 200,000. Please enter a higher amount or select NEFT as the transaction mode.';
@override
String get correctTpin => 'Please Enter the correct TPIN';
@override
String get insufficientFund =>
'Your account does not have sufficient balance';
@override
String get creditedTo => 'Credited To';
@override
String get selectTransactionType => 'Select transaction Type';
@override
String get proceed => 'Proceed';
@override
String get plsValidateBeneficiary =>
'Please validate beneficiary details first';
@override
String get accno7to20 => 'Account number must be between 7 and 20 digits';
@override
String get validateBeneficiaryproceeding =>
'Please validate beneficiary before proceeding';
}

View File

@@ -0,0 +1,725 @@
import 'app_localizations.dart';
// ignore_for_file: type=lint
/// The translations for Hindi (`hi`).
class AppLocalizationsHi extends AppLocalizations {
AppLocalizationsHi([String locale = 'hi']) : super(locale);
@override
String get profile => 'प्रोफ़ाइल';
@override
String get preferences => 'वरीयताएँ';
@override
String get language => 'भाषा';
@override
String get selectLanguage => 'भाषा चुनिए';
@override
String get english => 'अंग्रेज़ी';
@override
String get hindi => 'हिंदी';
@override
String get cancel => 'रद्द करें';
@override
String get home => 'होम';
@override
String get card => 'कार्ड';
@override
String get services => 'सेवाएं';
@override
String get quickPay => 'क्विक \n पे';
@override
String get quickLinks => 'त्वरित लिंक';
@override
String get recentTransactions => 'हाल की लेनदेन';
@override
String get accountNumber => 'खाता संख्या';
@override
String get enableBiometric => 'बायोमेट्रिक प्रमाणीकरण सक्षम करें';
@override
String get useBiometricPrompt =>
'तेज़ लॉगिन के लिए फिंगरप्रिंट/फेस आईडी का उपयोग करें?';
@override
String get later => 'बाद में';
@override
String get enable => 'सक्षम करें';
@override
String get noTransactions => 'इस खाते के लिए कोई लेनदेन नहीं मिला।';
@override
String get somethingWentWrong => 'कुछ गलत हो गया';
@override
String failedToLoad(Object error) {
return 'लेनदेन लोड करने में विफल: $error';
}
@override
String get failedToRefresh => 'डेटा रिफ्रेश करने में विफल';
@override
String get hi => 'नमस्ते';
@override
String get kMobile => 'के मोबाइल';
@override
String get scanBiometric => 'बायोमेट्रिक लॉगिन सक्षम करने के लिए स्कैन करें';
@override
String get savingsAccount => 'बचत खाता';
@override
String get loanAccount => 'ऋण खाता';
@override
String get termDeposit => 'मियादी जमा खाता';
@override
String get recurringDeposit => 'आवर्ती जमा खाता';
@override
String get unknownAccount => 'अज्ञात खाता प्रकार';
@override
String get customerInfo => 'ग्राहक \n जानकारी';
@override
String get fundTransfer => 'फंड ट्रांसफर';
@override
String get accountInfo => 'खाता जानकारी';
@override
String get accountStatement => 'खाता विवरण';
@override
String get handleCheque => 'चेक \n संभालें';
@override
String get manageBeneficiary => 'लाभार्थी \n प्रबंधन';
@override
String get contactUs => 'संपर्क \n करें';
@override
String get addBeneficiary => 'लाभार्थी जोड़ें';
@override
String get confirmAccountNumber => 'खाता संख्या की पुष्टि करें';
@override
String get name => 'नाम';
@override
String get ifscCode => 'आईएफ़एससी कोड';
@override
String get bankName => 'लाभार्थी बैंक का नाम';
@override
String get branchName => 'शाखा का नाम';
@override
String get accountType => 'खाते प्रकार';
@override
String get savings => 'बचत';
@override
String get current => 'चालू';
@override
String get phone => 'फ़ोन';
@override
String get validateAndAdd => 'सत्यापित करें और जोड़ें';
@override
String get beneficiaryAdded => 'लाभार्थी सफलतापूर्वक जोड़ा गया';
@override
String get invalidIfscFormat => 'अमान्य IFSC प्रारूप';
@override
String get noIfscDetails => 'इस IFSC के लिए कोई विवरण नहीं मिला';
@override
String get enterValidAccountNumber => 'कृपया एक मान्य खाता संख्या दर्ज करें';
@override
String get reenterAccountNumber => 'फिर से खाता संख्या दर्ज करें';
@override
String get accountMismatch => 'खाता संख्याएँ मेल नहीं खा रही हैं';
@override
String get nameRequired => 'नाम आवश्यक है';
@override
String get enterIfsc => 'IFSC कोड दर्ज करें';
@override
String get enterValidPhone => 'कृपया एक मान्य फोन नंबर दर्ज करें';
@override
String get payNow => 'अब भुगतान करें';
@override
String get beneficiaries => 'लाभार्थी';
@override
String get cif => 'सीआईएफ';
@override
String get activeAccounts => 'सक्रिय खातों की संख्या';
@override
String get mobileNumber => 'मोबाइल नंबर';
@override
String get dateOfBirth => 'जन्म तिथि';
@override
String get branchCode => 'शाखा कोड';
@override
String get branchAddress => 'शाखा पता';
@override
String get primaryId => 'प्राथमिक पहचान';
@override
String get quickPayOwnBank => 'क्विक पे - स्वयं का बैंक';
@override
String get debitAccountNumber => 'डेबिट खाता संख्या';
@override
String get accountNumberRequired => 'खाता संख्या आवश्यक है';
@override
String get validAccountNumber => 'एक मान्य खाता संख्या दर्ज करें';
@override
String get beneficiaryAccountType => 'लाभार्थी खाता प्रकार';
@override
String get loan => 'ऋण';
@override
String get selectAccountType => 'कृपया खाता प्रकार चुनें';
@override
String get amount => 'राशि';
@override
String get amountRequired => 'राशि आवश्यक है';
@override
String get validAmount => 'एक मान्य राशि दर्ज करें';
@override
String get swipeToPay => 'भुगतान करने के लिए स्वाइप करें';
@override
String get outsideBank => 'बाहरी बैंक';
@override
String get ownBank => 'स्वयं का बैंक';
@override
String get neft => 'एनईएफटी';
@override
String get rtgs => 'आरटीजीएस';
@override
String get imps => 'आईएमपीएस';
@override
String get quickPayOutsideBank => 'त्वरित भुगतान - बाहरी बैंक';
@override
String get debitFrom => 'से डेबिट करें';
@override
String get bankNameRequired => 'बैंक का नाम आवश्यक है';
@override
String get branchNameRequired => 'शाखा का नाम आवश्यक है';
@override
String get ifscRequired => 'आईएफएससी कोड आवश्यक है';
@override
String get phoneRequired => 'फ़ोन नंबर आवश्यक है';
@override
String get transactionMode => 'लेन-देन का माध्यम';
@override
String get payingVia => 'के माध्यम से भुगतान';
@override
String get accountOpeningDeposit => 'खाता खोलने का अनुरोध - जमा';
@override
String get accountOpeningLoan => 'खाता खोलने का अनुरोध - ऋण';
@override
String get branchLocator => 'शाखा लोकेटर';
@override
String get emailLaunchError => 'ईमेल क्लाइंट खोलने में विफल: ';
@override
String get dialerLaunchError => 'डायलर खोलने में विफल: ';
@override
String get writeToUs => 'हमें लिखें';
@override
String get keyContacts => 'मुख्य संपर्क';
@override
String get chairman => 'अध्यक्ष';
@override
String get managingDirector => 'प्रबंध निदेशक';
@override
String get gmWest => 'महाप्रबंधक (पश्चिम)';
@override
String get gmNorth => 'महाप्रबंधक (उत्तर)';
@override
String get enquiry => 'पूछताछ';
@override
String get fundTransferBeneficiary => 'फंड ट्रांसफर - लाभार्थी';
@override
String get enterAmount => 'राशि दर्ज करें';
@override
String get customerNumber => 'ग्राहक संख्या';
@override
String get productName => 'उत्पाद का नाम';
@override
String get accountStatus => 'खाता स्थिति';
@override
String get availableBalance => 'उपलब्ध शेष राशि';
@override
String get currentBalance => 'वर्तमान शेष राशि';
@override
String get filters => 'फ़िल्टर';
@override
String get fromDate => 'प्रारंभ तिथि';
@override
String get toDate => 'अंतिम तिथि';
@override
String get minAmount => 'न्यूनतम राशि';
@override
String get maxAmount => 'अधिकतम राशि';
@override
String get lastTenTransactions => 'अंतिम 10 लेनदेन प्रदर्शित किए जा रहे हैं';
@override
String get applyDebitCard => 'डेबिट कार्ड के लिए आवेदन करें';
@override
String get blockUnblockCard => 'कार्ड ब्लॉक/अनब्लॉक करें';
@override
String get changeCardPin => 'कार्ड पिन बदलें';
@override
String get cardNumber => 'कार्ड संख्या';
@override
String get cvv => 'सीवीवी';
@override
String get expiryDate => 'समाप्ति तिथि';
@override
String get next => 'आगे';
@override
String get block => 'ब्लॉक करें';
@override
String get approvedAmount => 'स्वीकृत राशि';
@override
String get failedToLoadTransactions => 'लेन-देन लोड करने में विफल';
@override
String get pleaseSelectDateFirst => 'कृपया पहले तिथि चुनें';
@override
String get cardBlocked => 'कार्ड ब्लॉक कर दिया गया है';
@override
String get blockCard => 'कार्ड ब्लॉक करें';
@override
String get enterValidCardNumber => 'मान्य कार्ड नंबर दर्ज करें';
@override
String get cvv3Digits => 'सीवीवी 3 अंकों का होना चाहिए';
@override
String get selectExpiryDate => 'समाप्ति तिथि चुनें';
@override
String get cardManagement => 'कार्ड प्रबंधन';
@override
String get paymentResult => 'भुगतान परिणाम';
@override
String get failedToShareScreenshot => 'स्क्रीनशॉट साझा करने में विफल';
@override
String get paymentSuccessful => 'भुगतान सफल';
@override
String get cardDetails => 'कार्ड विवरण';
@override
String get cardPin => 'कार्ड पिन';
@override
String get amountEntered => 'दर्ज की गई राशि';
@override
String get enterNewPin => 'नया पिन दर्ज करें';
@override
String get pleaseEnterNewPin => 'कृपया नया पिन दर्ज करें';
@override
String get pin4Digits => 'पिन कम से कम 4 अंकों का होना चाहिए';
@override
String get enterAgain => 'पुनः दर्ज करें';
@override
String get pinsDoNotMatch => 'PIN मेल नहीं खा रहे हैं। पुनः प्रयास करें।';
@override
String get submit => 'जमा करें';
@override
String get chequeManagement => 'चेक प्रबंधन';
@override
String get requestChequeBook => 'चेकबुक का अनुरोध करें';
@override
String get chequeDeposit => 'चेक जमा';
@override
String get stopCheque => 'चेक रोकें';
@override
String get revokeStop => 'रोक हटाएं';
@override
String get positivePay => 'पॉजिटिव पे';
@override
String get pinSetSuccess => 'पिन सफलतापूर्वक सेट किया गया';
@override
String get creditedAccount => 'क्रेडिटेड खाता';
@override
String get date => 'तिथि';
@override
String get paymentFailed => 'भुगतान विफल';
@override
String get share => 'साझा करें';
@override
String get done => 'पूर्ण';
@override
String get invalidOtp => 'अमान्य ओटीपी';
@override
String get enterOtp => 'ओटीपी दर्ज करें';
@override
String get otpVerification => 'ओटीपी सत्यापन';
@override
String get otpSentMessage =>
'अपने मोबाइल नंबर पर भेजा गया 4-अंकों का ओटीपी दर्ज करें';
@override
String get verifyOtp => 'ओटीपी सत्यापित करें';
@override
String get otpResent => 'ओटीपी पुनः भेजा गया';
@override
String get resendOtp => 'ओटीपी पुनः भेजें';
@override
String get setTpin => 'टी-पिन सेट करें';
@override
String get tpinRequired => 'टी-पिन आवश्यक है';
@override
String get tpinRequiredMessage =>
'सुरक्षित लेनदेन के लिए टी-पिन सेट करना आवश्यक है';
@override
String get setTpinTitle => 'टी-पिन सेट करें';
@override
String get tpinInfo =>
'आपका टी-पिन 6 अंकों का कोड है जिसका उपयोग लेन-देन को प्रमाणित करने के लिए किया जाता है। इसे सुरक्षित रखें और किसी से साझा न करें।';
@override
String get tpinFailed => 'टी-पिन सेट करने में विफल। कृपया पुनः प्रयास करें।';
@override
String get success => 'सफलता!';
@override
String get tpinSetSuccess => 'आपका टी-पिन सफलतापूर्वक सेट हो गया है';
@override
String get ok => 'ठीक है';
@override
String get pinsMismatchRetry => 'पिन मेल नहीं खाते। पुनः प्रयास करें।';
@override
String get pleaseEnter6Digits => 'कृपया 6 अंक दर्ज करें';
@override
String get setNewTpin => 'अपना नया टी-पिन सेट करें';
@override
String get confirmNewTpin => 'अपना नया टी-पिन पुष्टि करें';
@override
String get tpinStatusFailed => 'टी-पिन स्थिति की जांच करने में विफल';
@override
String get enter6DigitTpin => 'कृपया 6 अंकों का टी-पिन दर्ज करें';
@override
String get tpin => 'टी-पिन';
@override
String get enterTpin => 'अपना टी-पिन दर्ज करें';
@override
String get transactionSuccess => 'लेन-देन सफल रहा';
@override
String get on => 'पर';
@override
String get toAccountNumber => 'खाते संख्या में';
@override
String get shareText => 'साझा करें';
@override
String get enableFingerprintLogin => 'फिंगरप्रिंट लॉगिन सक्षम करें?';
@override
String get enableFingerprintMessage =>
'क्या आप तेज लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करना चाहेंगे?';
@override
String get no => 'नहीं';
@override
String get yes => 'हाँ';
@override
String get authenticateToEnable =>
'फिंगरप्रिंट लॉगिन सक्षम करने के लिए प्रमाणीकरण करें';
@override
String get exitApp => 'ऐप बंद करें';
@override
String get exitConfirmation => 'क्या आप वाकई ऐप से बाहर निकलना चाहते हैं?';
@override
String get loading => 'लोड हो रहा है......';
@override
String get enableFingerprintQuick =>
'तेज़ लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करें?';
@override
String get kccb => 'केसीसीबी';
@override
String get password => 'पासवर्ड';
@override
String get pleaseEnterUsername => 'कृपया उपयोगकर्ता नाम दर्ज करें';
@override
String get pleaseEnterPassword => 'कृपया पासवर्ड दर्ज करें';
@override
String get login => 'लॉगिन';
@override
String get or => 'या';
@override
String get register => 'रजिस्टर करें';
@override
String get authenticateToAccess => 'kmobile तक पहुंच के लिए प्रमाणीकरण करें';
@override
String get incorrectMPIN => 'गलत mPIN. कृपया पुनः प्रयास करें।';
@override
String get pleaseEnter4Digits => 'कृपया 4 अंक दर्ज करें।';
@override
String get enterMPIN => 'अपना mPIN दर्ज करें';
@override
String get setMPIN => 'अपना mPIN सेट करें';
@override
String get confirmMPIN => 'अपना mPIN की पुष्टि करें';
@override
String get kconnect => 'के-कनेक्ट';
@override
String get kccBankFull => 'कांगड़ा सेंट्रल को-ऑपरेटिव बैंक';
@override
String get themeColor => 'थीम रंग';
@override
String get selectThemeColor => 'थीम रंग चुनें';
@override
String get violet => 'बैंगनी';
@override
String get blue => 'नीला';
@override
String get invalidIfsc => 'अमान्य IFSC कोड';
@override
String get validIfsc => 'मान्य IFSC';
@override
String get beneficiaryAddedSuccess => 'लाभार्थी सफलतापूर्वक जोड़ा गया';
@override
String get beneficiaryAdditionFailed => 'लाभार्थी जोड़ने में विफल';
@override
String get noBeneficiaryFound => 'कोई लाभार्थी नहीं मिला';
@override
String get beneficiaryName => 'लाभार्थी नाम';
@override
String get validateBeneficiary => 'लाभार्थी को सत्यापित करें';
@override
String get themeMode => 'थीम मोड';
@override
String get transactionDetails => 'लेन-देन विवरण';
@override
String get transactionType => 'लेनदेन प्रकार';
@override
String get transferType => 'स्थानांतरण प्रकार';
@override
String get utrNo => 'यूटीआर नंबर';
@override
String get beneficiaryAccountNo => 'लाभार्थी खाता संख्या';
@override
String get invalidRtgs => 'RTGS के लिए अमान्य राशि';
@override
String get invalidRtgsPopUp =>
'RTGS लेनदेन के लिए न्यूनतम 2,00,000 रुपये की राशि की आवश्यकता होती है। कृपया अधिक राशि दर्ज करें या लेनदेन मोड के रूप में NEFT चुनें';
@override
String get correctTpin => 'कृपया सही टी-पिन दर्ज करें';
@override
String get insufficientFund => 'आपके खाते में पर्याप्त शेष राशि नहीं है';
@override
String get creditedTo => 'को श्रेय दिया गया';
@override
String get selectTransactionType => 'लेन-देन का प्रकार चुनें';
@override
String get proceed => 'आगे बढ़ना';
@override
String get plsValidateBeneficiary =>
'कृपया पहले लाभार्थी विवरण सत्यापित करें';
@override
String get accno7to20 => 'खाता संख्या सात से बीस अंकों के बीच होनी चाहिए';
@override
String get validateBeneficiaryproceeding =>
'कृपया आगे बढ़ने से पहले लाभार्थी को पट्टे पर मान्य करें';
}

View File

@@ -1,7 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:kmobile/features/security/security_error_screen.dart';
import 'package:kmobile/security/security_service.dart';
import 'di/injection.dart'; import 'di/injection.dart';
import 'app.dart'; import 'app.dart';
@@ -14,15 +12,6 @@ void main() async {
DeviceOrientation.portraitDown, DeviceOrientation.portraitDown,
]); ]);
// Check for device compromise
final compromisedMessage = await SecurityService.deviceCompromisedMessage;
// if (compromisedMessage != null) {
// runApp(MaterialApp(
// home: SecurityErrorScreen(message: compromisedMessage),
// ));
// return;
// }
// Initialize dependencies // Initialize dependencies
await setupDependencies(); await setupDependencies();
runApp(const KMobile()); runApp(const KMobile());

View File

@@ -29,4 +29,4 @@ class SecureStorage {
Future<void> deleteAll() async { Future<void> deleteAll() async {
await _storage.deleteAll(); await _storage.deleteAll();
} }
} }

View File

@@ -1,31 +0,0 @@
import 'dart:io';
import 'package:jailbreak_root_detection/jailbreak_root_detection.dart';
class SecurityService {
static Future<String?> get deviceCompromisedMessage async {
final isNotTrust = await JailbreakRootDetection.instance.isNotTrust;
if (isNotTrust) {
return 'Your device is rooted or jailbroken. For security reasons, you cannot access our services on a compromised device.';
}
final isRealDevice = await JailbreakRootDetection.instance.isRealDevice;
if (!isRealDevice) {
return 'Emulators are not allowed to access our services. Please use a real device.';
}
if (Platform.isAndroid) {
try {
final isOnExternalStorage =
await JailbreakRootDetection.instance.isOnExternalStorage;
if (isOnExternalStorage) {
return 'The application cannot be run from external storage.';
}
} catch (e) {
// Ignore
}
}
return null;
}
}

View File

@@ -1,81 +0,0 @@
import 'package:flutter/material.dart';
Widget getBankLogo(String? bankName, BuildContext context) {
if (bankName != null && bankName.toLowerCase().contains('state bank of')) {
return Image.asset(
'assets/images/sbi_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('kangra central')) {
return Image.asset(
'assets/images/logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('hdfc bank ltd')) {
return Image.asset(
'assets/images/hdfc_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('icici bank ltd')) {
return Image.asset(
'assets/images/icici_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null &&
bankName.toLowerCase().contains('punjab national bank')) {
return Image.asset(
'assets/images/pnb_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('axis')) {
return Image.asset(
'assets/images/axisBank_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('baroda')) {
return Image.asset(
'assets/images/bankofBaroda_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('canara bank')) {
return Image.asset(
'assets/images/canaraBank_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('kotak')) {
return Image.asset(
'assets/images/kotak_logo.png',
width: 40,
height: 40,
);
}
if (bankName != null && bankName.toLowerCase().contains('bank of india')) {
return Image.asset(
'assets/images/boi_logo.png',
width: 40,
height: 40,
);
} else {
return Icon(
Icons.account_balance,
size: 40,
color: Theme.of(context).colorScheme.outline,
);
}
}

View File

@@ -357,14 +357,6 @@ 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:

View File

@@ -36,7 +36,6 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.6 cupertino_icons: ^1.0.6
jailbreak_root_detection: ^1.1.6
equatable: ^2.0.7 equatable: ^2.0.7
dio: ^5.8.0+1 dio: ^5.8.0+1
flutter_secure_storage: ^9.2.4 flutter_secure_storage: ^9.2.4
@@ -97,7 +96,6 @@ flutter:
- assets/images/BankofBaroda_logo.png - assets/images/BankofBaroda_logo.png
- assets/images/canaraBank_logo.png - assets/images/canaraBank_logo.png
- assets/images/kotak_logo.png - assets/images/kotak_logo.png
- assets/images/boi_logo.png
- assets/images/kmobile_splash.jpg - assets/images/kmobile_splash.jpg
- assets/images/kmobile_splash2.png - assets/images/kmobile_splash2.png
- assets/images/icon.svg - assets/images/icon.svg