Compare commits
30 Commits
language-t
...
bf35ec61d5
Author | SHA1 | Date | |
---|---|---|---|
bf35ec61d5 | |||
180d3a3a60 | |||
|
737ce6cce6 | ||
|
e75f48aed5 | ||
|
5ee88403dd | ||
|
7fe8e8f084 | ||
|
59eb509dda | ||
|
5f41c6e7f4 | ||
|
36474786c1 | ||
|
df51c4f30b | ||
|
cf8588b336 | ||
04c992c934 | |||
fc76528206 | |||
7527db3d2f | |||
19d3487552 | |||
|
60a5703c35 | ||
09618db28e | |||
712553e49f | |||
842eef2cc7 | |||
|
e6ea764785 | ||
e2a809d363 | |||
f48bfabb4a | |||
76d5874e19 | |||
913e31a6ab | |||
7f5258b5b7 | |||
|
82951b7919 | ||
8ae26e2f18 | |||
e7bbab13ba | |||
72862492c0 | |||
|
f91d0f739b |
3
.gitignore
vendored
@@ -41,3 +41,6 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
lib/l10n/app_localizations.dart
|
||||
lib/l10n/app_localizations_en.dart
|
||||
lib/l10n/app_localizations_hi.dart
|
||||
|
@@ -7,6 +7,9 @@
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
analyzer:
|
||||
errors:
|
||||
dead_code: ignore
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
|
BIN
assets/images/BankofBaroda_logo.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/images/axisbank_logo.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
assets/images/boi_logo.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
assets/images/canaraBank_logo.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
assets/images/hdfc_logo.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
assets/images/icici_logo.png
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
assets/images/kotak_logo.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
assets/images/pnb_logo.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/images/sbi_logo.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
@@ -4,7 +4,6 @@ import '../../features/auth/models/auth_token.dart';
|
||||
import '../../features/auth/models/auth_credentials.dart';
|
||||
import '../../core/errors/exceptions.dart';
|
||||
|
||||
|
||||
class AuthService {
|
||||
final Dio _dio;
|
||||
AuthService(this._dio);
|
||||
@@ -15,7 +14,7 @@ class AuthService {
|
||||
'/api/auth/login',
|
||||
data: credentials.toJson(),
|
||||
);
|
||||
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return AuthToken.fromJson(response.data);
|
||||
} else {
|
||||
@@ -30,7 +29,8 @@ class AuthService {
|
||||
}
|
||||
throw NetworkException('Network error during login');
|
||||
} catch (e) {
|
||||
throw UnexpectedException('Unexpected error during login: ${e.toString()}');
|
||||
throw UnexpectedException(
|
||||
'Unexpected error during login: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class AuthService {
|
||||
'/auth/refresh',
|
||||
data: {'refresh_token': refreshToken},
|
||||
);
|
||||
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return AuthToken.fromJson(response.data);
|
||||
} else {
|
||||
@@ -54,7 +54,7 @@ class AuthService {
|
||||
Future<bool> checkTpin() async {
|
||||
try {
|
||||
final response = await _dio.get('/api/auth/tpin');
|
||||
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return response.data['tpinSet'] as bool;
|
||||
} else {
|
||||
@@ -66,7 +66,8 @@ class AuthService {
|
||||
}
|
||||
throw NetworkException('Network error during TPIN check');
|
||||
} catch (e) {
|
||||
throw UnexpectedException('Unexpected error during TPIN check: ${e.toString()}');
|
||||
throw UnexpectedException(
|
||||
'Unexpected error during TPIN check: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ class AuthService {
|
||||
'/api/auth/tpin',
|
||||
data: {'tpin': tpin},
|
||||
);
|
||||
|
||||
|
||||
if (response.statusCode != 200) {
|
||||
throw AuthException('Failed to set TPIN');
|
||||
}
|
||||
@@ -86,8 +87,8 @@ class AuthService {
|
||||
}
|
||||
throw NetworkException('Network error during TPIN setup');
|
||||
} catch (e) {
|
||||
throw UnexpectedException('Unexpected error during TPIN setup: ${e.toString()}');
|
||||
throw UnexpectedException(
|
||||
'Unexpected error during TPIN setup: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:kmobile/data/models/ifsc.dart';
|
||||
import 'package:kmobile/data/models/beneficiary.dart';
|
||||
@@ -9,14 +11,16 @@ class BeneficiaryService {
|
||||
|
||||
Future<String> validateBeneficiaryWithinBank(String accountNumber) async {
|
||||
try {
|
||||
final response = await _dio.get('/api/beneficiary/validate/within-bank', queryParameters: {
|
||||
final response = await _dio
|
||||
.get('/api/beneficiary/validate/within-bank', queryParameters: {
|
||||
'accountNumber': accountNumber,
|
||||
});
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return response.data['name'];
|
||||
} else {
|
||||
throw Exception(response.data['error'] ?? 'Failed to validate beneficiary');
|
||||
throw Exception(
|
||||
response.data['error'] ?? 'Failed to validate beneficiary');
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw Exception('Network error: ${e.message}');
|
||||
@@ -24,156 +28,81 @@ class BeneficiaryService {
|
||||
throw Exception('Unexpected error: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<ifsc?> validateIFSC(String ifscCode) async {
|
||||
try {
|
||||
final response = await _dio.get('/api/beneficiary/ifsc-details', queryParameters: {
|
||||
"ifscCode": ifscCode
|
||||
}
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return ifsc.fromJson(response.data);
|
||||
Future<Ifsc> validateIFSC(String ifscCode) async {
|
||||
try {
|
||||
final response = await _dio.get('/api/beneficiary/ifsc-details',
|
||||
queryParameters: {"ifscCode": ifscCode});
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return Ifsc.fromJson(response.data);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
if (e.response?.statusCode == 404) {
|
||||
throw Exception('INVALID IFSC CODE');
|
||||
}
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
if (e.response?.statusCode == 404) {
|
||||
print('Invalid IFSC code.');
|
||||
} else {
|
||||
print('API error: ${e.message}');
|
||||
}
|
||||
} catch (e) {
|
||||
print('Unexpected error: $e');
|
||||
return Ifsc.fromJson({});
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
///Step 1: Validate beneficiary (returns refNo)
|
||||
Future<String?> validateBeneficiary({
|
||||
Future<String> validateBeneficiary({
|
||||
required String accountNo,
|
||||
required String ifscCode,
|
||||
required String remitterName,
|
||||
}) async {
|
||||
|
||||
try {
|
||||
final response = await _dio.post(
|
||||
'/api/beneficiary/validate/outside_bank',
|
||||
queryParameters: {
|
||||
'accountNo': accountNo,
|
||||
'ifscCode': ifscCode,
|
||||
'remitterName': remitterName,
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return response.data['refNo'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error validating beneficiary: $e");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// Step 2: Check validation status (returns Beneficiary name if success)
|
||||
Future<String?> checkValidationStatus(String refNo) async {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
'/api/beneficiary/check',
|
||||
queryParameters: {
|
||||
'refNo': refNo,
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200 && response.data != null) {
|
||||
return Beneficiary.fromJson(response.data).name;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error checking validation status: $e");
|
||||
return null;
|
||||
log('inside validate beneficiary service');
|
||||
final response = await _dio.get(
|
||||
'/api/beneficiary/validate/outside-bank',
|
||||
queryParameters: {
|
||||
'accountNo': accountNo,
|
||||
'ifscCode': ifscCode,
|
||||
'remitterName': remitterName,
|
||||
},
|
||||
);
|
||||
if (response.statusCode != 200) {
|
||||
throw Exception("Invalid Beneficiary Details");
|
||||
}
|
||||
return response.data['name'];
|
||||
}
|
||||
|
||||
// Send Data for Validation
|
||||
Future<void> sendForValidation(Beneficiary beneficiary) async {
|
||||
Future<bool> sendForValidation(Beneficiary beneficiary) async {
|
||||
try {
|
||||
print(beneficiary.toJson());
|
||||
final response = await _dio.post(
|
||||
'/api/beneficiary/add',
|
||||
'/api/beneficiary',
|
||||
data: beneficiary.toJson(),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
print("SENT FOR VALIDATION");
|
||||
return true;
|
||||
} else {
|
||||
print("VALIDATION REQUEST FAILED: ${response.statusCode}");
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
print("ERROR IN SENDING REQUEST: $e");
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
// Poll to check if beneficiary is found
|
||||
Future<bool> checkIfFound(String accountNo) async {
|
||||
const int timeoutInSeconds = 30;
|
||||
const int intervalInSeconds = 2;
|
||||
const int maxTries = timeoutInSeconds ~/ intervalInSeconds;
|
||||
|
||||
int attempts = 0;
|
||||
|
||||
while (attempts < maxTries) {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
'/api/beneficiary/check?',
|
||||
queryParameters: {
|
||||
'accountNo': accountNo
|
||||
}
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
print("FOUND");
|
||||
return true;
|
||||
} else if (response.statusCode == 404) {
|
||||
print("NOT FOUND");
|
||||
}
|
||||
} catch (e) {
|
||||
print("ERROR DURING STATUS: $e");
|
||||
}
|
||||
attempts++;
|
||||
}
|
||||
|
||||
print("Beneficiary not found within timeout.");
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<List<Beneficiary>> fetchBeneficiaryList() async{
|
||||
Future<List<Beneficiary>> fetchBeneficiaryList() async {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
"/api/beneficiary/get",
|
||||
options: Options(
|
||||
"/api/beneficiary",
|
||||
options: Options(
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return Beneficiary.listFromJson(response.data);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return Beneficiary.listFromJson(response.data);
|
||||
} else {
|
||||
throw Exception("Failed to fetch beneficiaries");
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error fetching beneficiaries: $e");
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
33
lib/api/services/imps_service.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:kmobile/data/models/imps_response.dart';
|
||||
import 'package:kmobile/data/models/imps_transaction.dart';
|
||||
|
||||
class ImpsService {
|
||||
final Dio _dio;
|
||||
|
||||
ImpsService(this._dio);
|
||||
|
||||
Future<ImpsResponse> processImpsTransaction(
|
||||
ImpsTransaction transaction) async {
|
||||
try {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
final response = await _dio.post(
|
||||
'/api/payment/imps',
|
||||
data: transaction.toJson(),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return ImpsResponse.fromJson(response.data);
|
||||
} else {
|
||||
throw Exception(
|
||||
'IMPS transaction failed with status code: ${response.statusCode}');
|
||||
}
|
||||
} on DioException {
|
||||
rethrow;
|
||||
} catch (e) {
|
||||
throw Exception('An unexpected error occurred: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
31
lib/api/services/neft_service.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:kmobile/data/models/neft_response.dart';
|
||||
import 'package:kmobile/data/models/neft_transaction.dart';
|
||||
|
||||
class NeftService {
|
||||
final Dio _dio;
|
||||
|
||||
NeftService(this._dio);
|
||||
|
||||
Future<NeftResponse> processNeftTransaction(
|
||||
NeftTransaction transaction) async {
|
||||
try {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
final response = await _dio.post(
|
||||
'/api/payment/neft',
|
||||
data: transaction.toJson(),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return NeftResponse.fromJson(response.data);
|
||||
} else {
|
||||
throw Exception(
|
||||
'NEFT transaction failed with status code: ${response.statusCode}');
|
||||
}
|
||||
} on DioException {
|
||||
rethrow;
|
||||
} catch (e) {
|
||||
throw Exception('An unexpected error occurred: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,4 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:kmobile/data/models/payment_response.dart';
|
||||
import 'package:kmobile/data/models/transfer.dart';
|
||||
@@ -11,7 +10,7 @@ class PaymentService {
|
||||
Future<PaymentResponse> processQuickPayWithinBank(Transfer transfer) async {
|
||||
try {
|
||||
await Future.delayed(const Duration(seconds: 3)); // Simulate delay
|
||||
|
||||
|
||||
await _dio.post('/api/payment/transfer', data: transfer.toJson());
|
||||
|
||||
return PaymentResponse(
|
||||
|
34
lib/api/services/rtgs_service.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:kmobile/data/models/imps_transaction.dart';
|
||||
import 'package:kmobile/data/models/rtgs_response.dart';
|
||||
import 'package:kmobile/data/models/rtgs_transaction.dart';
|
||||
|
||||
class RtgsService {
|
||||
final Dio _dio;
|
||||
|
||||
RtgsService(this._dio);
|
||||
|
||||
Future<RtgsResponse> processRtgsTransaction(
|
||||
RtgsTransaction transaction) async {
|
||||
try {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
final response = await _dio.post(
|
||||
'/api/payment/rtgs',
|
||||
data: transaction.toJson(),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return RtgsResponse.fromJson(response.data);
|
||||
} else {
|
||||
throw Exception(
|
||||
'RTGS transaction failed with status code: ${response.statusCode}');
|
||||
}
|
||||
} on DioException {
|
||||
rethrow;
|
||||
} catch (e) {
|
||||
throw Exception('An unexpected error occurred: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
|
||||
processImpsTransaction(ImpsTransaction impsTx) {}
|
||||
}
|
@@ -28,4 +28,4 @@ class UserService {
|
||||
throw Exception('Unexpected error: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
141
lib/app.dart
@@ -26,7 +26,8 @@ class KMobile extends StatefulWidget {
|
||||
State<KMobile> createState() => _KMobileState();
|
||||
|
||||
static void setLocale(BuildContext context, Locale newLocale) {
|
||||
final _KMobileState? state = context.findAncestorStateOfType<_KMobileState>();
|
||||
final _KMobileState? state =
|
||||
context.findAncestorStateOfType<_KMobileState>();
|
||||
state?.setLocale(newLocale);
|
||||
}
|
||||
}
|
||||
@@ -35,7 +36,6 @@ class _KMobileState extends State<KMobile> {
|
||||
bool showSplash = true;
|
||||
Locale? _locale;
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -57,7 +57,6 @@ class _KMobileState extends State<KMobile> {
|
||||
_locale = Locale(langCode);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void setLocale(Locale locale) {
|
||||
@@ -66,54 +65,50 @@ class _KMobileState extends State<KMobile> {
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Set status bar color and brightness
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: Brightness.dark,
|
||||
),
|
||||
);
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: Brightness.dark,
|
||||
),
|
||||
);
|
||||
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<AuthCubit>(create: (_) => getIt<AuthCubit>()),
|
||||
BlocProvider<ThemeCubit>(create: (_) => getIt<ThemeCubit>()),
|
||||
],
|
||||
child: BlocBuilder<ThemeCubit, ThemeState>(
|
||||
builder: (context, themeState) {
|
||||
print('global theme state changed');
|
||||
print(themeState);
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: _locale ?? const Locale('en'),
|
||||
supportedLocales: const [
|
||||
Locale('en'),
|
||||
Locale('hi'),
|
||||
],
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
title: 'kMobile',
|
||||
//theme: AppThemes.getLightTheme(themeState.themeType),
|
||||
theme: themeState.getThemeData(),
|
||||
// darkTheme: AppThemes.getDarkTheme(themeState.themeType),
|
||||
themeMode: ThemeMode.system,
|
||||
onGenerateRoute: AppRoutes.generateRoute,
|
||||
initialRoute: AppRoutes.splash,
|
||||
home: showSplash ? const SplashScreen() : const AuthGate(),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<AuthCubit>(create: (_) => getIt<AuthCubit>()),
|
||||
BlocProvider<ThemeCubit>(create: (_) => ThemeCubit()),
|
||||
],
|
||||
child: BlocBuilder<ThemeCubit, ThemeState>(
|
||||
builder: (context, themeState) {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: _locale ?? const Locale('en'),
|
||||
supportedLocales: const [
|
||||
Locale('en'),
|
||||
Locale('hi'),
|
||||
],
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
title: 'kMobile',
|
||||
theme: themeState.getThemeData(),
|
||||
//darkTheme: themeState.getThemeData(),
|
||||
themeMode: ThemeMode.light,
|
||||
onGenerateRoute: AppRoutes.generateRoute,
|
||||
initialRoute: AppRoutes.splash,
|
||||
home: showSplash ? const SplashScreen() : const AuthGate(),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
class AuthGate extends StatefulWidget {
|
||||
const AuthGate({super.key});
|
||||
|
||||
@@ -142,8 +137,7 @@ class _AuthGateState extends State<AuthGate> {
|
||||
final mpin = await storage.read('mpin');
|
||||
final biometric = await storage.read('biometric_enabled');
|
||||
setState(() {
|
||||
_isLoggedIn =
|
||||
accessToken != null &&
|
||||
_isLoggedIn = accessToken != null &&
|
||||
accessTokenExpiry != null &&
|
||||
DateTime.parse(accessTokenExpiry).isAfter(DateTime.now());
|
||||
_hasMPin = mpin != null;
|
||||
@@ -158,9 +152,13 @@ class _AuthGateState extends State<AuthGate> {
|
||||
final localAuth = LocalAuthentication();
|
||||
final canCheck = await localAuth.canCheckBiometrics;
|
||||
if (!canCheck) return false;
|
||||
String localizedReason = "";
|
||||
if (mounted) {
|
||||
localizedReason = AppLocalizations.of(context).authenticateToAccess;
|
||||
}
|
||||
try {
|
||||
final didAuth = await localAuth.authenticate(
|
||||
localizedReason: AppLocalizations.of(context).authenticateToAccess,
|
||||
localizedReason: localizedReason,
|
||||
options: const AuthenticationOptions(
|
||||
stickyAuth: true,
|
||||
biometricOnly: true,
|
||||
@@ -172,7 +170,6 @@ class _AuthGateState extends State<AuthGate> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (_checking) {
|
||||
@@ -261,11 +258,14 @@ class _AuthGateState extends State<AuthGate> {
|
||||
if (optIn == true) {
|
||||
final canCheck = await localAuth.canCheckBiometrics;
|
||||
bool didAuth = false;
|
||||
String authEnable = "";
|
||||
if (context.mounted) {
|
||||
authEnable = AppLocalizations.of(context).authenticateToEnable;
|
||||
}
|
||||
|
||||
if (canCheck) {
|
||||
didAuth = await localAuth.authenticate(
|
||||
localizedReason:
|
||||
AppLocalizations.of(context).authenticateToEnable,
|
||||
localizedReason: authEnable,
|
||||
options: const AuthenticationOptions(
|
||||
stickyAuth: true,
|
||||
biometricOnly: true,
|
||||
@@ -278,11 +278,13 @@ class _AuthGateState extends State<AuthGate> {
|
||||
}
|
||||
}
|
||||
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const NavigationScaffold(),
|
||||
),
|
||||
);
|
||||
if (context.mounted) {
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const NavigationScaffold(),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -310,13 +312,6 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
|
||||
const ServiceScreen(),
|
||||
];
|
||||
|
||||
void _onItemTapped(int index) {
|
||||
setState(() {
|
||||
_selectedIndex = index;
|
||||
});
|
||||
_pageController.jumpToPage(index);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
@@ -357,10 +352,16 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
currentIndex: _selectedIndex,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor, // Light blue background
|
||||
backgroundColor: Theme.of(context)
|
||||
.scaffoldBackgroundColor, // Light blue background
|
||||
selectedItemColor: Theme.of(context).primaryColor,
|
||||
unselectedItemColor: Colors.black54,
|
||||
onTap: _onItemTapped,
|
||||
onTap: (index) {
|
||||
setState(() {
|
||||
_selectedIndex = index;
|
||||
});
|
||||
_pageController.jumpToPage(index);
|
||||
},
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
icon: const Icon(Icons.home_filled),
|
||||
@@ -416,8 +417,12 @@ class BiometricPromptScreen extends StatelessWidget {
|
||||
onCompleted();
|
||||
return;
|
||||
}
|
||||
String localizedReason = "";
|
||||
if (context.mounted) {
|
||||
localizedReason = AppLocalizations.of(context).enableFingerprintQuick;
|
||||
}
|
||||
final didAuth = await localAuth.authenticate(
|
||||
localizedReason: AppLocalizations.of(context).enableFingerprintQuick,
|
||||
localizedReason: localizedReason,
|
||||
options: const AuthenticationOptions(
|
||||
stickyAuth: true,
|
||||
biometricOnly: true,
|
||||
|
@@ -13,7 +13,7 @@ import '../features/dashboard/screens/dashboard_screen.dart';
|
||||
class AppRoutes {
|
||||
// Private constructor to prevent instantiation
|
||||
AppRoutes._();
|
||||
|
||||
|
||||
// Route names
|
||||
static const String splash = '/';
|
||||
static const String login = '/login';
|
||||
@@ -25,7 +25,7 @@ class AppRoutes {
|
||||
static const String accounts = '/accounts';
|
||||
static const String transactions = '/transactions';
|
||||
static const String payments = '/payments';
|
||||
|
||||
|
||||
// Route generator
|
||||
static Route<dynamic> generateRoute(RouteSettings settings) {
|
||||
switch (settings.name) {
|
||||
@@ -35,13 +35,16 @@ class AppRoutes {
|
||||
return MaterialPageRoute(builder: (_) => const LoginScreen());
|
||||
|
||||
case mPin:
|
||||
return MaterialPageRoute(builder: (_) => const MPinScreen(mode: MPinMode.enter,));
|
||||
return MaterialPageRoute(
|
||||
builder: (_) => const MPinScreen(
|
||||
mode: MPinMode.enter,
|
||||
));
|
||||
|
||||
case register:
|
||||
// Placeholder - create the RegisterScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const RegisterScreen());
|
||||
return _errorRoute();
|
||||
|
||||
|
||||
case forgotPassword:
|
||||
// Placeholder - create the ForgotPasswordScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const ForgotPasswordScreen());
|
||||
@@ -49,31 +52,30 @@ class AppRoutes {
|
||||
|
||||
case navigationScaffold:
|
||||
return MaterialPageRoute(builder: (_) => const NavigationScaffold());
|
||||
|
||||
|
||||
case dashboard:
|
||||
return MaterialPageRoute(builder: (_) => const DashboardScreen());
|
||||
|
||||
|
||||
case accounts:
|
||||
// Placeholder - create the AccountsScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const AccountsScreen());
|
||||
return _errorRoute();
|
||||
|
||||
|
||||
case transactions:
|
||||
// Placeholder - create the TransactionsScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const TransactionsScreen());
|
||||
return _errorRoute();
|
||||
|
||||
|
||||
case payments:
|
||||
// Placeholder - create the PaymentsScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const PaymentsScreen());
|
||||
return _errorRoute();
|
||||
|
||||
|
||||
|
||||
default:
|
||||
return _errorRoute();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Error route
|
||||
static Route<dynamic> _errorRoute() {
|
||||
return MaterialPageRoute(builder: (_) {
|
||||
@@ -87,4 +89,4 @@ class AppRoutes {
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
enum ThemeType {
|
||||
violet,
|
||||
green,
|
||||
orange,
|
||||
blue,
|
||||
}
|
||||
violet,
|
||||
green,
|
||||
orange,
|
||||
blue,
|
||||
}
|
||||
|
@@ -2,31 +2,40 @@ import 'package:flutter/material.dart';
|
||||
import 'theme_type.dart';
|
||||
|
||||
class AppThemes {
|
||||
static ThemeData getLightTheme(ThemeType type) {
|
||||
switch (type) {
|
||||
case ThemeType.green:
|
||||
return ThemeData(primarySwatch: Colors.green);
|
||||
case ThemeType.orange:
|
||||
return ThemeData(primarySwatch: Colors.orange);
|
||||
case ThemeType.blue:
|
||||
return ThemeData(primarySwatch: Colors.blue);
|
||||
case ThemeType.violet:
|
||||
default:
|
||||
return ThemeData(primarySwatch: Colors.deepPurple);
|
||||
}
|
||||
}
|
||||
static ThemeData getLightTheme(ThemeType type) {
|
||||
// Define a seed color based on the theme type
|
||||
final Color seedColor;
|
||||
switch (type) {
|
||||
case ThemeType.green:
|
||||
seedColor = Colors.green;
|
||||
break;
|
||||
case ThemeType.orange:
|
||||
seedColor = Colors.orange;
|
||||
break;
|
||||
case ThemeType.blue:
|
||||
seedColor = Colors.blue;
|
||||
break;
|
||||
case ThemeType.violet:
|
||||
default:
|
||||
seedColor = Colors.deepPurple;
|
||||
break;
|
||||
}
|
||||
|
||||
static ThemeData getDarkTheme(ThemeType type) {
|
||||
switch (type) {
|
||||
case ThemeType.green:
|
||||
return ThemeData.dark().copyWith(primaryColor: Colors.green);
|
||||
case ThemeType.orange:
|
||||
return ThemeData.dark().copyWith(primaryColor: Colors.orange);
|
||||
case ThemeType.blue:
|
||||
return ThemeData.dark().copyWith(primaryColor: Colors.blue);
|
||||
case ThemeType.violet:
|
||||
default:
|
||||
return ThemeData.dark().copyWith(primaryColor: Colors.deepPurple);
|
||||
}
|
||||
}
|
||||
// Create a ColorScheme from the seed color
|
||||
final colorScheme = ColorScheme.fromSeed(
|
||||
seedColor: seedColor,
|
||||
brightness: Brightness.light, // Explicitly set for a light theme
|
||||
);
|
||||
|
||||
// Create the ThemeData from the ColorScheme
|
||||
return ThemeData.from(
|
||||
colorScheme: colorScheme,
|
||||
useMaterial3: true, // Recommended for modern Flutter apps
|
||||
).copyWith(
|
||||
scaffoldBackgroundColor: Colors.white,
|
||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||
backgroundColor: colorScheme.surface,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,8 +1,8 @@
|
||||
class AppException implements Exception {
|
||||
final String message;
|
||||
|
||||
|
||||
AppException(this.message);
|
||||
|
||||
|
||||
@override
|
||||
String toString() => message;
|
||||
}
|
||||
@@ -11,7 +11,7 @@ class NetworkException extends AppException {
|
||||
NetworkException(super.message);
|
||||
}
|
||||
|
||||
class AuthException implements Exception{
|
||||
class AuthException implements Exception {
|
||||
final String message;
|
||||
AuthException(this.message);
|
||||
|
||||
@@ -21,4 +21,4 @@ class AuthException implements Exception{
|
||||
|
||||
class UnexpectedException extends AppException {
|
||||
UnexpectedException(super.message);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
// ignore_for_file: non_constant_identifier_names
|
||||
|
||||
class Beneficiary {
|
||||
@@ -9,6 +7,7 @@ class Beneficiary {
|
||||
final String ifscCode;
|
||||
final String? bankName;
|
||||
final String? branchName;
|
||||
final String? tpin;
|
||||
|
||||
Beneficiary({
|
||||
required this.accountNo,
|
||||
@@ -17,30 +16,43 @@ class Beneficiary {
|
||||
required this.ifscCode,
|
||||
this.bankName,
|
||||
this.branchName,
|
||||
this.tpin,
|
||||
});
|
||||
|
||||
factory Beneficiary.fromJson(Map<String, dynamic> json) {
|
||||
return Beneficiary(
|
||||
accountNo: json['accountNo'] ?? '',
|
||||
accountType: json['accountType'] ?? '',
|
||||
accountNo: json['account_no'] ?? json['accountNo'] ?? '',
|
||||
accountType: json['account_type'] ?? json['accountType'] ?? '',
|
||||
name: json['name'] ?? '',
|
||||
ifscCode: json['ifscCode'] ?? '',
|
||||
bankName: json['bankName'] ?? '',
|
||||
branchName: json['branchName'] ?? '',
|
||||
ifscCode: json['ifsc_code'] ?? json['ifscCode'] ?? '',
|
||||
bankName: json['bank_name'] ?? json['bankName'] ?? '',
|
||||
branchName: json['branch_name'] ?? json['branchName'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
final Map<String, dynamic> json = {
|
||||
'accountNo': accountNo,
|
||||
'accountType': accountType,
|
||||
'name': name,
|
||||
'ifscCode' : ifscCode,
|
||||
'ifscCode': ifscCode,
|
||||
};
|
||||
if (bankName != null && bankName!.isNotEmpty) {
|
||||
json['bankName'] = bankName;
|
||||
}
|
||||
if (branchName != null && branchName!.isNotEmpty) {
|
||||
json['branchName'] = branchName;
|
||||
}
|
||||
if (tpin != null && tpin!.isNotEmpty) {
|
||||
json['tpin'] = tpin;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
static List<Beneficiary> listFromJson(List<dynamic> jsonList) {
|
||||
final beneficiaryList = jsonList.map((beneficiary) => Beneficiary.fromJson(beneficiary)).toList();
|
||||
final beneficiaryList = jsonList
|
||||
.map((beneficiary) => Beneficiary.fromJson(beneficiary))
|
||||
.toList();
|
||||
print(beneficiaryList);
|
||||
return beneficiaryList;
|
||||
}
|
||||
@@ -49,4 +61,4 @@ class Beneficiary {
|
||||
String toString() {
|
||||
return 'Beneficiary(accountNo: $accountNo, accountType: $accountType, ifscCode: $ifscCode, name: $name)';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,45 +0,0 @@
|
||||
class BeneficiaryRecieve {
|
||||
final String accountNo;
|
||||
final String accountType;
|
||||
final String name;
|
||||
final String ifscCode;
|
||||
final String bankName;
|
||||
final String branchName;
|
||||
|
||||
|
||||
BeneficiaryRecieve({
|
||||
required this.accountNo,
|
||||
required this.accountType,
|
||||
required this.name,
|
||||
required this.ifscCode,
|
||||
required this.bankName,
|
||||
required this.branchName,
|
||||
});
|
||||
|
||||
factory BeneficiaryRecieve.fromJson(Map<String, dynamic> json) {
|
||||
return BeneficiaryRecieve(
|
||||
accountNo: json['account_no'] ?? '',
|
||||
accountType: json['account_type'] ?? '',
|
||||
name: json['name'] ?? '',
|
||||
ifscCode: json['ifsc_code'] ?? '',
|
||||
bankName: json['bank_name'] ?? '',
|
||||
branchName: json['branch_name'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'account_no': accountNo,
|
||||
'account_type': accountType,
|
||||
'name': name,
|
||||
'ifsc_code' : ifscCode,
|
||||
'bank_name' : bankName,
|
||||
'branch_name' : branchName
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ListBeneficiary(accountNo: $accountNo, accountType: $accountType, ifscCode: $ifscCode, name: $name, bankName: $bankName, branchName: $branchName)';
|
||||
}
|
||||
}
|
@@ -1,16 +1,16 @@
|
||||
class ifsc {
|
||||
class Ifsc {
|
||||
final String ifscCode;
|
||||
final String bankName;
|
||||
final String branchName;
|
||||
|
||||
ifsc({
|
||||
Ifsc({
|
||||
required this.ifscCode,
|
||||
required this.bankName,
|
||||
required this.branchName,
|
||||
});
|
||||
|
||||
factory ifsc.fromJson(Map<String, dynamic> json) {
|
||||
return ifsc(
|
||||
factory Ifsc.fromJson(Map<String, dynamic> json) {
|
||||
return Ifsc(
|
||||
ifscCode: json['ifsc_code'] ?? '',
|
||||
bankName: json['bank_name'] ?? '',
|
||||
branchName: json['branch_name'] ?? '',
|
||||
@@ -29,4 +29,4 @@ class ifsc {
|
||||
String toString() {
|
||||
return 'IFSC(ifscCode: $ifscCode, bankName: $bankName, branchName: $branchName)';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
lib/data/models/imps_response.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class ImpsResponse {
|
||||
final String message;
|
||||
final String utr;
|
||||
|
||||
ImpsResponse({
|
||||
required this.message,
|
||||
required this.utr,
|
||||
});
|
||||
|
||||
factory ImpsResponse.fromJson(Map<String, dynamic> json) {
|
||||
return ImpsResponse(
|
||||
message: json['message'] ?? '',
|
||||
utr: json['utr'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
31
lib/data/models/imps_transaction.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
class ImpsTransaction {
|
||||
final String fromAccount;
|
||||
final String toAccount;
|
||||
final String amount;
|
||||
final String ifscCode;
|
||||
final String? remitterName;
|
||||
final String beneficiaryName;
|
||||
final String tpin;
|
||||
|
||||
ImpsTransaction({
|
||||
required this.fromAccount,
|
||||
required this.toAccount,
|
||||
required this.amount,
|
||||
required this.ifscCode,
|
||||
this.remitterName,
|
||||
required this.beneficiaryName,
|
||||
required this.tpin,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'fromAccount': fromAccount,
|
||||
'toAccount': toAccount,
|
||||
'amount': amount,
|
||||
'ifscCode': ifscCode,
|
||||
'remitterName': remitterName,
|
||||
'beneficiaryName': beneficiaryName,
|
||||
'tpin': tpin,
|
||||
};
|
||||
}
|
||||
}
|
16
lib/data/models/neft_response.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class NeftResponse {
|
||||
final String message;
|
||||
final String utr;
|
||||
|
||||
NeftResponse({
|
||||
required this.message,
|
||||
required this.utr,
|
||||
});
|
||||
|
||||
factory NeftResponse.fromJson(Map<String, dynamic> json) {
|
||||
return NeftResponse(
|
||||
message: json['message'] ?? '',
|
||||
utr: json['utr'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
31
lib/data/models/neft_transaction.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
class NeftTransaction {
|
||||
final String fromAccount;
|
||||
final String toAccount;
|
||||
final String amount;
|
||||
final String ifscCode;
|
||||
final String remitterName;
|
||||
final String beneficiaryName;
|
||||
final String tpin;
|
||||
|
||||
NeftTransaction({
|
||||
required this.fromAccount,
|
||||
required this.toAccount,
|
||||
required this.amount,
|
||||
required this.ifscCode,
|
||||
required this.remitterName,
|
||||
required this.beneficiaryName,
|
||||
required this.tpin,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'fromAccount': fromAccount,
|
||||
'toAccount': toAccount,
|
||||
'amount': amount,
|
||||
'ifscCode': ifscCode,
|
||||
'remitterName': remitterName,
|
||||
'beneficiaryName': beneficiaryName,
|
||||
'tpin': tpin,
|
||||
};
|
||||
}
|
||||
}
|
@@ -6,6 +6,7 @@ class PaymentResponse {
|
||||
final String? currency;
|
||||
final String? errorMessage;
|
||||
final String? errorCode;
|
||||
final String? utr;
|
||||
|
||||
PaymentResponse({
|
||||
required this.isSuccess,
|
||||
@@ -15,5 +16,6 @@ class PaymentResponse {
|
||||
this.currency,
|
||||
this.errorMessage,
|
||||
this.errorCode,
|
||||
this.utr,
|
||||
});
|
||||
}
|
||||
|
16
lib/data/models/rtgs_response.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class RtgsResponse {
|
||||
final String message;
|
||||
final String utr;
|
||||
|
||||
RtgsResponse({
|
||||
required this.message,
|
||||
required this.utr,
|
||||
});
|
||||
|
||||
factory RtgsResponse.fromJson(Map<String, dynamic> json) {
|
||||
return RtgsResponse(
|
||||
message: json['message'] ?? '',
|
||||
utr: json['utr'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
31
lib/data/models/rtgs_transaction.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
class RtgsTransaction {
|
||||
final String fromAccount;
|
||||
final String toAccount;
|
||||
final String amount;
|
||||
final String ifscCode;
|
||||
final String remitterName;
|
||||
final String beneficiaryName;
|
||||
final String tpin;
|
||||
|
||||
RtgsTransaction({
|
||||
required this.fromAccount,
|
||||
required this.toAccount,
|
||||
required this.amount,
|
||||
required this.ifscCode,
|
||||
required this.remitterName,
|
||||
required this.beneficiaryName,
|
||||
required this.tpin,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'fromAccount': fromAccount,
|
||||
'toAccount': toAccount,
|
||||
'amount': amount,
|
||||
'ifscCode': ifscCode,
|
||||
'remitterName': remitterName,
|
||||
'beneficiaryName': beneficiaryName,
|
||||
'tpin': tpin,
|
||||
};
|
||||
}
|
||||
}
|
@@ -32,7 +32,7 @@ class TransferResponse {
|
||||
TransferResponse({
|
||||
required this.status,
|
||||
required this.message,
|
||||
required this.error,
|
||||
required this.error,
|
||||
});
|
||||
|
||||
factory TransferResponse.fromJson(Map<String, dynamic> json) {
|
||||
@@ -42,4 +42,4 @@ class TransferResponse {
|
||||
error: json['error'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ class AuthRepository {
|
||||
final AuthService _authService;
|
||||
final UserService _userService;
|
||||
final SecureStorage _secureStorage;
|
||||
|
||||
|
||||
static const _accessTokenKey = 'access_token';
|
||||
static const _tokenExpiryKey = 'token_expiry';
|
||||
|
||||
@@ -18,35 +18,37 @@ class AuthRepository {
|
||||
|
||||
Future<List<User>> login(String customerNo, String password) async {
|
||||
// Create credentials and call service
|
||||
final credentials = AuthCredentials(customerNo: customerNo, password: password);
|
||||
final credentials =
|
||||
AuthCredentials(customerNo: customerNo, password: password);
|
||||
final authToken = await _authService.login(credentials);
|
||||
|
||||
|
||||
// Save token securely
|
||||
await _saveAuthToken(authToken);
|
||||
|
||||
|
||||
// Get and save user profile
|
||||
final users = await _userService.getUserDetails();
|
||||
return users;
|
||||
}
|
||||
|
||||
|
||||
Future<bool> isLoggedIn() async {
|
||||
final token = await _getAuthToken();
|
||||
return token != null && !token.isExpired;
|
||||
}
|
||||
|
||||
|
||||
Future<String?> getAccessToken() async {
|
||||
final token = await _getAuthToken();
|
||||
if (token == null) return null;
|
||||
|
||||
|
||||
return token.accessToken;
|
||||
}
|
||||
|
||||
|
||||
// Private helper methods
|
||||
Future<void> _saveAuthToken(AuthToken token) async {
|
||||
await _secureStorage.write(_accessTokenKey, token.accessToken);
|
||||
await _secureStorage.write(_tokenExpiryKey, token.expiresAt.toIso8601String());
|
||||
await _secureStorage.write(
|
||||
_tokenExpiryKey, token.expiresAt.toIso8601String());
|
||||
}
|
||||
|
||||
|
||||
Future<AuthToken?> _getAuthToken() async {
|
||||
final accessToken = await _secureStorage.read(_accessTokenKey);
|
||||
final expiryString = await _secureStorage.read(_tokenExpiryKey);
|
||||
@@ -59,4 +61,4 @@ class AuthRepository {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,12 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:kmobile/data/models/transaction.dart';
|
||||
|
||||
abstract class TransactionRepository {
|
||||
Future<List<Transaction>> fetchTransactions(String accountNo);
|
||||
Future<List<Transaction>> fetchTransactions(String accountNo,
|
||||
{DateTime? fromDate, DateTime? toDate});
|
||||
}
|
||||
|
||||
class TransactionRepositoryImpl implements TransactionRepository {
|
||||
@@ -10,9 +14,23 @@ class TransactionRepositoryImpl implements TransactionRepository {
|
||||
TransactionRepositoryImpl(this._dio);
|
||||
|
||||
@override
|
||||
Future<List<Transaction>> fetchTransactions(String accountNo) async {
|
||||
Future<List<Transaction>> fetchTransactions(String accountNo,
|
||||
{DateTime? fromDate, DateTime? toDate}) async {
|
||||
final queryParameters = <String, String>{};
|
||||
|
||||
final resp = await _dio.get('/api/transactions/account/$accountNo');
|
||||
if (fromDate != null) {
|
||||
queryParameters['fromDate'] = DateFormat('ddMMyyyy').format(fromDate);
|
||||
}
|
||||
if (toDate != null) {
|
||||
queryParameters['toDate'] = DateFormat('ddMMyyyy').format(toDate);
|
||||
}
|
||||
|
||||
log('query params below');
|
||||
log(queryParameters.toString());
|
||||
final resp = await _dio.get(
|
||||
'/api/transactions/account/$accountNo',
|
||||
queryParameters: queryParameters.isNotEmpty ? queryParameters : null,
|
||||
);
|
||||
|
||||
if (resp.statusCode != 200) {
|
||||
throw Exception(
|
||||
@@ -25,4 +43,4 @@ class TransactionRepositoryImpl implements TransactionRepository {
|
||||
.map((e) => Transaction.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import 'package:kmobile/data/models/transfer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
|
||||
abstract class TransferRepository {
|
||||
Future<TransferResponse> transfer(Transfer transfer);
|
||||
}
|
||||
@@ -25,4 +24,4 @@ class TransferRepositoryImpl implements TransferRepository {
|
||||
|
||||
return TransferResponse.fromJson(resp.data as Map<String, dynamic>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,6 @@
|
||||
import 'package:kmobile/api/services/rtgs_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:dio/dio.dart';
|
||||
import 'package:kmobile/api/services/beneficiary_service.dart';
|
||||
@@ -11,14 +14,12 @@ import '../data/repositories/auth_repository.dart';
|
||||
import '../features/auth/controllers/auth_cubit.dart';
|
||||
import '../security/secure_storage.dart';
|
||||
|
||||
|
||||
final getIt = GetIt.instance;
|
||||
|
||||
Future<void> setupDependencies() async {
|
||||
|
||||
//getIt.registerLazySingleton<ThemeController>(() => ThemeController());
|
||||
//getIt.registerLazySingleton<ThemeModeController>(() => ThemeModeController());
|
||||
getIt.registerSingleton<ThemeCubit>( ThemeCubit());
|
||||
getIt.registerSingleton<ThemeCubit>(ThemeCubit());
|
||||
|
||||
// Register Dio client
|
||||
getIt.registerSingleton<Dio>(_createDioClient());
|
||||
@@ -42,6 +43,9 @@ Future<void> setupDependencies() async {
|
||||
|
||||
getIt.registerSingleton<PaymentService>(PaymentService(getIt<Dio>()));
|
||||
getIt.registerSingleton<BeneficiaryService>(BeneficiaryService(getIt<Dio>()));
|
||||
getIt.registerSingleton<NeftService>(NeftService(getIt<Dio>()));
|
||||
getIt.registerSingleton<RtgsService>(RtgsService(getIt<Dio>()));
|
||||
getIt.registerSingleton<ImpsService>(ImpsService(getIt<Dio>()));
|
||||
|
||||
// Add auth interceptor after repository is available
|
||||
getIt<Dio>().interceptors.add(
|
||||
@@ -51,17 +55,16 @@ Future<void> setupDependencies() async {
|
||||
// Register controllers/cubits
|
||||
getIt.registerFactory<AuthCubit>(
|
||||
() => AuthCubit(getIt<AuthRepository>(), getIt<UserService>()));
|
||||
|
||||
}
|
||||
|
||||
Dio _createDioClient() {
|
||||
final dio = Dio(
|
||||
BaseOptions(
|
||||
baseUrl:
|
||||
//'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080',
|
||||
'http://localhost:8081',
|
||||
'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080',
|
||||
// 'http://localhost:8081',
|
||||
connectTimeout: const Duration(seconds: 5),
|
||||
receiveTimeout: const Duration(seconds: 3),
|
||||
receiveTimeout: const Duration(seconds: 10),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
|
@@ -4,7 +4,7 @@ class Account {
|
||||
final String accountType;
|
||||
final double balance;
|
||||
final String currency;
|
||||
|
||||
|
||||
Account({
|
||||
required this.id,
|
||||
required this.accountNumber,
|
||||
@@ -12,4 +12,4 @@ class Account {
|
||||
required this.balance,
|
||||
required this.currency,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -88,12 +88,6 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
|
||||
}).toList(),
|
||||
),
|
||||
|
||||
/*InfoRow(
|
||||
title: AppLocalizations.of(context).accountNumber,
|
||||
value: users[selectedIndex].accountNo ?? 'N/A'),
|
||||
// InfoRow(title: 'Nominee Customer No', value: user.nomineeCustomerNo),
|
||||
// InfoRow(title: 'SMS Service', value: user.smsService),
|
||||
// InfoRow(title: 'Missed Call Service', value: user.missedCallService),*/
|
||||
InfoRow(
|
||||
title: AppLocalizations.of(context).customerNumber,
|
||||
value: selectedUser.cifNumber ?? 'N/A',
|
||||
|
@@ -6,6 +6,7 @@ import 'package:kmobile/data/models/transaction.dart';
|
||||
import 'package:kmobile/data/repositories/transaction_repository.dart';
|
||||
import 'package:kmobile/di/injection.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import 'transaction_details_screen.dart';
|
||||
|
||||
class AccountStatementScreen extends StatefulWidget {
|
||||
final String accountNo;
|
||||
@@ -36,7 +37,11 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
});
|
||||
try {
|
||||
final repo = getIt<TransactionRepository>();
|
||||
final txs = await repo.fetchTransactions(widget.accountNo);
|
||||
final txs = await repo.fetchTransactions(
|
||||
widget.accountNo,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
);
|
||||
setState(() => _transactions = txs);
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
@@ -115,7 +120,8 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).accountStatement,
|
||||
style: const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -181,56 +187,28 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
controller: _minAmountController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).minAmount,
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _loadTransactions,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
),
|
||||
child: Text(
|
||||
"Search",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
controller: _maxAmountController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).maxAmount,
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.done,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
child: ElevatedButton(
|
||||
onPressed: _loadTransactions,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
),
|
||||
child: Icon(
|
||||
Symbols.arrow_forward,
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 35),
|
||||
if (!_txLoading && _transactions.isNotEmpty)
|
||||
if (!_txLoading &&
|
||||
_transactions.isNotEmpty &&
|
||||
fromDate == null &&
|
||||
toDate == null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 12.0),
|
||||
child: Text(
|
||||
@@ -252,7 +230,8 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: CircleAvatar(
|
||||
radius: 12,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
),
|
||||
title: Shimmer.fromColors(
|
||||
@@ -283,7 +262,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
fontSize: 16, color: Colors.grey[600]),
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
: ListView.separated(
|
||||
itemCount: _transactions.length,
|
||||
itemBuilder: (context, index) {
|
||||
final tx = _transactions[index];
|
||||
@@ -296,23 +275,35 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
tx.type == 'CR' ? Colors.green : Colors.red,
|
||||
),
|
||||
title: Text(
|
||||
tx.name != null
|
||||
? (tx.name!.length > 18
|
||||
? tx.name!.substring(0, 20)
|
||||
: tx.name!)
|
||||
: '',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
subtitle: Text(
|
||||
tx.date ?? '',
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
trailing: Text(
|
||||
"₹${tx.amount}",
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
tx.date ?? '',
|
||||
style: const TextStyle(fontSize: 15),
|
||||
),
|
||||
subtitle: Text(
|
||||
tx.name != null
|
||||
? (tx.name!.length > 18
|
||||
? tx.name!.substring(0, 22)
|
||||
: tx.name!)
|
||||
: '',
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
trailing: Text(
|
||||
"₹${tx.amount}",
|
||||
style: const TextStyle(fontSize: 17),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => TransactionDetailsScreen(
|
||||
transaction: tx),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) {
|
||||
return const Divider();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
|
110
lib/features/accounts/screens/transaction_details_screen.dart
Normal file
@@ -0,0 +1,110 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/l10n/app_localizations.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
|
||||
class TransactionDetailsScreen extends StatelessWidget {
|
||||
final dynamic transaction;
|
||||
|
||||
const TransactionDetailsScreen({super.key, required this.transaction});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bool isCredit = transaction.type?.toUpperCase() == 'CR';
|
||||
|
||||
return Scaffold(
|
||||
appBar:
|
||||
AppBar(title: Text(AppLocalizations.of(context).transactionDetails)),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// Amount + icon + Share Button
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
"₹ ${transaction.amount}",
|
||||
style: const TextStyle(
|
||||
fontSize: 40,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Icon(
|
||||
isCredit ? Symbols.call_received : Symbols.call_made,
|
||||
color: isCredit ? Colors.green : Colors.red,
|
||||
size: 28,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// Date centered
|
||||
Text(
|
||||
transaction.date ?? "",
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.grey,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: ListView(
|
||||
children: [
|
||||
_buildDetailRow(AppLocalizations.of(context).transactionType,
|
||||
transaction.type ?? ""),
|
||||
_buildDetailRow(AppLocalizations.of(context).transferType,
|
||||
transaction.name.split("/").first ?? ""),
|
||||
if (transaction.name.length > 12) ...[
|
||||
_buildDetailRow(AppLocalizations.of(context).utrNo,
|
||||
transaction.name.split("= ")[1].split(" ")[0] ?? ""),
|
||||
_buildDetailRow(
|
||||
AppLocalizations.of(context).beneficiaryAccountNo,
|
||||
transaction.name.split("A/C ").last ?? "")
|
||||
]
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDetailRow(String label, String value) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"$label: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Expanded(
|
||||
child: Text(
|
||||
value,
|
||||
style: const TextStyle(fontSize: 20),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,48 +1,25 @@
|
||||
import 'dart:developer';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'theme_state.dart';
|
||||
import 'package:kmobile/config/theme_type.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'theme_state.dart';
|
||||
|
||||
class ThemeCubit extends Cubit<ThemeState> {
|
||||
ThemeCubit(): super(ThemeViolet()) {
|
||||
ThemeCubit() : super(const ThemeState(themeType: ThemeType.violet)) {
|
||||
loadTheme();
|
||||
}
|
||||
|
||||
Future<void> loadTheme() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final themeIndex = prefs.getInt('theme_type') ?? 0;
|
||||
// final isDark = prefs.getBool('is_dark_mode') ?? false;
|
||||
|
||||
final type = ThemeType.values[themeIndex];
|
||||
switch(type) {
|
||||
case ThemeType.blue:
|
||||
emit(ThemeBlue());
|
||||
case ThemeType.violet:
|
||||
emit(ThemeViolet());
|
||||
default:
|
||||
emit(ThemeViolet());
|
||||
}
|
||||
emit(ThemeState(themeType: type));
|
||||
}
|
||||
|
||||
Future<void> changeTheme(ThemeType type) async {
|
||||
print("Attempting to change theme to: ${type.toString()}");
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt('theme_type', type.index);
|
||||
log("Mode Change");
|
||||
print("mode changed");
|
||||
switch(type) {
|
||||
case ThemeType.blue:
|
||||
emit(ThemeBlue());
|
||||
print('blue matched');
|
||||
break;
|
||||
case ThemeType.violet:
|
||||
emit(ThemeViolet());
|
||||
print('violet matched');
|
||||
break;
|
||||
default:
|
||||
emit(ThemeBlue());
|
||||
print('default macthed');
|
||||
}
|
||||
emit(ThemeState(themeType: type));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,27 +1,17 @@
|
||||
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;
|
||||
|
||||
abstract class ThemeState extends Equatable {
|
||||
getThemeData();
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
const ThemeState({required this.themeType});
|
||||
|
||||
class ThemeBlue extends ThemeState {
|
||||
|
||||
@override
|
||||
getThemeData() {
|
||||
print('returning blue theme');
|
||||
return AppThemes.getLightTheme(ThemeType.blue);
|
||||
ThemeData getThemeData() {
|
||||
return AppThemes.getLightTheme(themeType);
|
||||
}
|
||||
}
|
||||
|
||||
class ThemeViolet extends ThemeState {
|
||||
@override
|
||||
getThemeData() {
|
||||
print('returning violet theme');
|
||||
return AppThemes.getLightTheme(ThemeType.violet);
|
||||
}
|
||||
}
|
||||
List<Object?> get props => [themeType];
|
||||
}
|
||||
|
@@ -6,12 +6,12 @@ import 'package:equatable/equatable.dart';
|
||||
class AuthToken extends Equatable {
|
||||
final String accessToken;
|
||||
final DateTime expiresAt;
|
||||
|
||||
|
||||
const AuthToken({
|
||||
required this.accessToken,
|
||||
required this.expiresAt,
|
||||
});
|
||||
|
||||
|
||||
factory AuthToken.fromJson(Map<String, dynamic> json) {
|
||||
return AuthToken(
|
||||
accessToken: json['token'],
|
||||
@@ -29,7 +29,8 @@ class AuthToken extends Equatable {
|
||||
// Pad the payload if necessary
|
||||
String normalized = base64Url.normalize(payload);
|
||||
final payloadMap = json.decode(utf8.decode(base64Url.decode(normalized)));
|
||||
if (payloadMap is! Map<String, dynamic> || !payloadMap.containsKey('exp')) {
|
||||
if (payloadMap is! Map<String, dynamic> ||
|
||||
!payloadMap.containsKey('exp')) {
|
||||
throw Exception('Invalid payload');
|
||||
}
|
||||
final exp = payloadMap['exp'];
|
||||
@@ -40,9 +41,9 @@ class AuthToken extends Equatable {
|
||||
return DateTime.now().add(const Duration(hours: 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool get isExpired => DateTime.now().isAfter(expiresAt);
|
||||
|
||||
|
||||
@override
|
||||
List<Object> get props => [accessToken, expiresAt];
|
||||
}
|
||||
|
@@ -23,23 +23,9 @@ class LoginScreenState extends State<LoginScreen>
|
||||
final _passwordController = TextEditingController();
|
||||
bool _obscurePassword = 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
|
||||
void dispose() {
|
||||
_logoController.dispose();
|
||||
_customerNumberController.dispose();
|
||||
_passwordController.dispose();
|
||||
super.dispose();
|
||||
@@ -48,9 +34,9 @@ class LoginScreenState extends State<LoginScreen>
|
||||
void _submitForm() {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
context.read<AuthCubit>().login(
|
||||
_customerNumberController.text.trim(),
|
||||
_passwordController.text,
|
||||
);
|
||||
_customerNumberController.text.trim(),
|
||||
_passwordController.text,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +49,7 @@ class LoginScreenState extends State<LoginScreen>
|
||||
if (state is Authenticated) {
|
||||
final storage = getIt<SecureStorage>();
|
||||
final mpin = await storage.read('mpin');
|
||||
if (!context.mounted) return;
|
||||
if (mpin == null) {
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
@@ -100,21 +87,17 @@ class LoginScreenState extends State<LoginScreen>
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// 🔁 Animated Blinking Logo
|
||||
FadeTransition(
|
||||
opacity: _logoAnimation,
|
||||
child: Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 150,
|
||||
height: 150,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return Icon(
|
||||
Icons.account_balance,
|
||||
size: 100,
|
||||
color: Theme.of(context).primaryColor,
|
||||
);
|
||||
},
|
||||
),
|
||||
Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 150,
|
||||
height: 150,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return Icon(
|
||||
Icons.account_balance,
|
||||
size: 100,
|
||||
color: Theme.of(context).primaryColor,
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
// Title
|
||||
@@ -133,14 +116,14 @@ class LoginScreenState extends State<LoginScreen>
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).customerNumber,
|
||||
// prefixIcon: Icon(Icons.person),
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -159,8 +142,7 @@ class LoginScreenState extends State<LoginScreen>
|
||||
controller: _passwordController,
|
||||
obscureText: _obscurePassword,
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) =>
|
||||
_submitForm(), // ⌨️ Enter key submits
|
||||
onFieldSubmitted: (_) => _submitForm(),
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).password,
|
||||
border: const OutlineInputBorder(),
|
||||
@@ -202,7 +184,8 @@ class LoginScreenState extends State<LoginScreen>
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Theme.of(context).primaryColorDark,
|
||||
side: const BorderSide(color: Colors.black, width: 1),
|
||||
elevation: 0,
|
||||
@@ -211,22 +194,22 @@ class LoginScreenState extends State<LoginScreen>
|
||||
? const CircularProgressIndicator()
|
||||
: Text(
|
||||
AppLocalizations.of(context).login,
|
||||
style: TextStyle(fontSize: 16),
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(child: Divider()),
|
||||
const Expanded(child: Divider()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(AppLocalizations.of(context).or),
|
||||
),
|
||||
Expanded(child: Divider()),
|
||||
const Expanded(child: Divider()),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -257,227 +240,3 @@ class LoginScreenState extends State<LoginScreen>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/*import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:kmobile/di/injection.dart';
|
||||
import 'package:kmobile/features/auth/screens/mpin_screen.dart';
|
||||
import 'package:kmobile/security/secure_storage.dart';
|
||||
import '../../../app.dart';
|
||||
import '../controllers/auth_cubit.dart';
|
||||
import '../controllers/auth_state.dart';
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
const LoginScreen({super.key});
|
||||
|
||||
@override
|
||||
LoginScreenState createState() => LoginScreenState();
|
||||
}
|
||||
|
||||
class LoginScreenState extends State<LoginScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
final _customerNumberController = TextEditingController();
|
||||
final _passwordController = TextEditingController();
|
||||
bool _obscurePassword = true;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_customerNumberController.dispose();
|
||||
_passwordController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _submitForm() {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
context.read<AuthCubit>().login(
|
||||
_customerNumberController.text.trim(),
|
||||
_passwordController.text,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// appBar: AppBar(title: const Text('Login')),
|
||||
body: BlocConsumer<AuthCubit, AuthState>(
|
||||
listener: (context, state) async {
|
||||
if (state is Authenticated) {
|
||||
final storage = getIt<SecureStorage>();
|
||||
final mpin = await storage.read('mpin');
|
||||
if (mpin == null) {
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => MPinScreen(
|
||||
mode: MPinMode.set,
|
||||
onCompleted: (_) {
|
||||
Navigator.of(context, rootNavigator: true)
|
||||
.pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const NavigationScaffold()),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(builder: (_) => const NavigationScaffold()),
|
||||
);
|
||||
}
|
||||
} else if (state is AuthError) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(state.message)),
|
||||
);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset('assets/images/logo.png', width: 150, height: 150,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const Icon(Icons.account_balance,
|
||||
size: 100, color: Colors.blue);
|
||||
}),
|
||||
const SizedBox(height: 16),
|
||||
// Title
|
||||
const Text(
|
||||
'KCCB',
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blue),
|
||||
),
|
||||
const SizedBox(height: 48),
|
||||
|
||||
TextFormField(
|
||||
controller: _customerNumberController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Customer Number',
|
||||
// prefixIcon: Icon(Icons.person),
|
||||
border: OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please enter your username';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
TextFormField(
|
||||
controller: _passwordController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Password',
|
||||
// prefixIcon: const Icon(Icons.lock),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
_obscurePassword
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_obscurePassword = !_obscurePassword;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
obscureText: _obscurePassword,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
SizedBox(
|
||||
width: 250,
|
||||
child: ElevatedButton(
|
||||
onPressed: state is AuthLoading ? null : _submitForm,
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Colors.white,
|
||||
foregroundColor: Colors.blueAccent,
|
||||
side: const BorderSide(color: Colors.black, width: 1),
|
||||
elevation: 0),
|
||||
child: state is AuthLoading
|
||||
? const CircularProgressIndicator()
|
||||
: const Text(
|
||||
'Login',
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(child: Divider()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text('OR'),
|
||||
),
|
||||
Expanded(child: Divider()),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
|
||||
// Register Button
|
||||
SizedBox(
|
||||
width: 250,
|
||||
child: ElevatedButton(
|
||||
//disable until registration is implemented
|
||||
onPressed: null,
|
||||
style: OutlinedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Colors.lightBlue[100],
|
||||
foregroundColor: Colors.black),
|
||||
child: const Text('Register'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@@ -46,6 +46,7 @@ class _MPinScreenState extends State<MPinScreen> {
|
||||
final auth = LocalAuthentication();
|
||||
if (await auth.canCheckBiometrics) {
|
||||
final didAuth = await auth.authenticate(
|
||||
// ignore: use_build_context_synchronously
|
||||
localizedReason: AppLocalizations.of(context).authenticateToAccess,
|
||||
options: const AuthenticationOptions(biometricOnly: true),
|
||||
);
|
||||
@@ -197,7 +198,9 @@ class _MPinScreenState extends State<MPinScreen> {
|
||||
key == '<' ? '⌫' : key,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: key == 'Enter' ? Theme.of(context).primaryColor : Colors.black,
|
||||
color: key == 'Enter'
|
||||
? Theme.of(context).primaryColor
|
||||
: Colors.black,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@@ -19,11 +19,8 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
|
||||
|
||||
// Automatically go to logizn after 4 seconds
|
||||
Timer(const Duration(seconds: 4), () {
|
||||
|
||||
widget.onContinue();
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -73,7 +70,8 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(color: Theme.of(context).scaffoldBackgroundColor),
|
||||
child: CircularProgressIndicator(
|
||||
color: Theme.of(context).scaffoldBackgroundColor),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -81,61 +79,3 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/*import 'package:flutter/material.dart';
|
||||
|
||||
class WelcomeScreen extends StatelessWidget {
|
||||
final VoidCallback onContinue;
|
||||
|
||||
const WelcomeScreen({super.key, required this.onContinue});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(32.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Spacer(),
|
||||
const Text(
|
||||
'Welcome to',
|
||||
style: TextStyle(fontSize: 28, color: Colors.black87),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'KCCB',
|
||||
style: TextStyle(
|
||||
fontSize: 42,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.indigo,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 150,
|
||||
height: 150,
|
||||
),
|
||||
const Spacer(),
|
||||
ElevatedButton(
|
||||
onPressed: onContinue,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.indigo,
|
||||
foregroundColor: Colors.white,
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 28, vertical: 20),
|
||||
),
|
||||
child: const Text('Proceed to Login'),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@@ -1,22 +1,21 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:kmobile/api/services/beneficiary_service.dart';
|
||||
import 'package:kmobile/data/models/ifsc.dart';
|
||||
import 'package:kmobile/data/models/beneficiary.dart';
|
||||
import 'package:kmobile/data/models/user.dart';
|
||||
import 'beneficiary_result_page.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
import '../../../di/injection.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart';
|
||||
|
||||
class AddBeneficiaryScreen extends StatefulWidget {
|
||||
final List<User>? users;
|
||||
final int? selectedIndex;
|
||||
final String customerName;
|
||||
|
||||
const AddBeneficiaryScreen({
|
||||
super.key,
|
||||
this.users,
|
||||
this.selectedIndex,
|
||||
required this.customerName,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -26,7 +25,6 @@ class AddBeneficiaryScreen extends StatefulWidget {
|
||||
class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
late User selectedUser = (widget.users ?? [])[widget.selectedIndex!];
|
||||
final TextEditingController accountNumberController = TextEditingController();
|
||||
final TextEditingController confirmAccountNumberController =
|
||||
TextEditingController();
|
||||
@@ -35,12 +33,12 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
final TextEditingController branchNameController = TextEditingController();
|
||||
final TextEditingController ifscController = TextEditingController();
|
||||
final TextEditingController phoneController = TextEditingController();
|
||||
|
||||
String? _beneficiaryName;
|
||||
final service = getIt<BeneficiaryService>();
|
||||
|
||||
bool _isValidating = false;
|
||||
bool _isBeneficiaryValidated = false;
|
||||
// ignore: unused_field
|
||||
String? _validationError;
|
||||
|
||||
late String accountType;
|
||||
|
||||
@override
|
||||
@@ -53,167 +51,163 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
ifsc? _ifscData;
|
||||
bool _isLoading = false; //for validateIFSC()
|
||||
|
||||
void _validateIFSC() async {
|
||||
var beneficiaryService = getIt<BeneficiaryService>();
|
||||
final ifsc = ifscController.text.trim().toUpperCase();
|
||||
if (ifsc.isEmpty) return;
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_ifscData = null;
|
||||
});
|
||||
void _validateIFSC() async {
|
||||
var beneficiaryService = getIt<BeneficiaryService>();
|
||||
final ifsc = ifscController.text.trim().toUpperCase();
|
||||
if (ifsc.isEmpty) return;
|
||||
|
||||
final result = await beneficiaryService.validateIFSC(ifsc);
|
||||
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_ifscData = result;
|
||||
});
|
||||
|
||||
if (result == null) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(AppLocalizations.of(context).invalidIfsc)),
|
||||
);
|
||||
bankNameController.clear();
|
||||
branchNameController.clear();
|
||||
} else {
|
||||
print("${AppLocalizations.of(context).validIfsc}: ${result.bankName}, ${result.branchName}");
|
||||
bankNameController.text = result.bankName;
|
||||
branchNameController.text = result.branchName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<void> _validateBeneficiary() async {
|
||||
// start spinner / disable button
|
||||
setState(() {
|
||||
_isValidating = true;
|
||||
_validationError = null;
|
||||
_isBeneficiaryValidated = false;
|
||||
nameController.text = ''; // clear previous name
|
||||
});
|
||||
|
||||
final String accountNo = accountNumberController.text.trim();
|
||||
final String ifsc = ifscController.text.trim();
|
||||
final String remitter = selectedUser.name ?? '';
|
||||
|
||||
final service = getIt<BeneficiaryService>();
|
||||
try {
|
||||
// Step 1: call validate API -> get refNo
|
||||
final String? refNo = await service.validateBeneficiary(
|
||||
accountNo: accountNo,
|
||||
ifscCode: ifsc,
|
||||
remitterName: remitter,
|
||||
);
|
||||
|
||||
if (refNo == null || refNo.isEmpty) {
|
||||
setState(() {
|
||||
_validationError = 'Validation request failed. Please check details.';
|
||||
_isBeneficiaryValidated = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 2: poll checkValidationStatus for up to 30 seconds
|
||||
const int timeoutSeconds = 30;
|
||||
const int intervalSeconds = 2;
|
||||
int elapsed = 0;
|
||||
String? foundName;
|
||||
|
||||
while (elapsed < timeoutSeconds) {
|
||||
final String? name = await service.checkValidationStatus(refNo);
|
||||
|
||||
if (name != null && name.trim().isNotEmpty) {
|
||||
foundName = name.trim();
|
||||
break;
|
||||
if (mounted) {
|
||||
if (result.bankName == '') {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(AppLocalizations.of(context).invalidIfsc)),
|
||||
);
|
||||
bankNameController.clear();
|
||||
branchNameController.clear();
|
||||
} else {
|
||||
bankNameController.text = result.bankName;
|
||||
branchNameController.text = result.branchName;
|
||||
}
|
||||
|
||||
await Future.delayed(const Duration(seconds: intervalSeconds));
|
||||
elapsed += intervalSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
void _validateBeneficiary() async {
|
||||
FocusScope.of(context).unfocus();
|
||||
setState(() {
|
||||
_isValidating = true;
|
||||
_validationError = null;
|
||||
_isBeneficiaryValidated = false;
|
||||
nameController.text = ''; // clear previous name
|
||||
});
|
||||
|
||||
final String accountNo = accountNumberController.text.trim();
|
||||
final String ifsc = ifscController.text.trim();
|
||||
final String remitter = widget.customerName;
|
||||
|
||||
final service = getIt<BeneficiaryService>();
|
||||
try {
|
||||
final String beneficiaryName = await service.validateBeneficiary(
|
||||
accountNo: accountNo,
|
||||
ifscCode: ifsc,
|
||||
remitterName: remitter,
|
||||
);
|
||||
|
||||
if (foundName != null) {
|
||||
setState(() {
|
||||
nameController.text = foundName!;
|
||||
nameController.text = beneficiaryName;
|
||||
_isBeneficiaryValidated = true;
|
||||
_validationError = null;
|
||||
});
|
||||
} else {
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
_validationError = 'Beneficiary not found within timeout.';
|
||||
_validationError = e.toString();
|
||||
_isBeneficiaryValidated = false;
|
||||
});
|
||||
}
|
||||
} catch (e, st) {
|
||||
// handle unexpected errors
|
||||
// print or log if you want
|
||||
debugPrint('Error validating beneficiary: $e\n$st');
|
||||
setState(() {
|
||||
_validationError = 'Something went wrong. Please try again.';
|
||||
_isBeneficiaryValidated = false;
|
||||
});
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isValidating = false;
|
||||
});
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isValidating = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
String _selectedAccountType = 'Savings'; // default value
|
||||
|
||||
void validateAndAddBeneficiary() async {
|
||||
// Show spinner and disable UI
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false, // Prevent dismiss on tap outside
|
||||
builder: (BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async => false, // Disable back button
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
final beneficiary = Beneficiary(
|
||||
accountNo: accountNumberController.text.trim(),
|
||||
accountType: _selectedAccountType,
|
||||
name: nameController.text.trim(),
|
||||
ifscCode: ifscController.text.trim(),
|
||||
);
|
||||
|
||||
var service = getIt<BeneficiaryService>();
|
||||
|
||||
try {
|
||||
await service.sendForValidation(beneficiary);
|
||||
bool isFound = await service.checkIfFound(beneficiary.accountNo);
|
||||
|
||||
if (context.mounted) {
|
||||
Navigator.pop(context); // Close the spinner
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => BeneficiaryResultPage(isSuccess: isFound),
|
||||
),
|
||||
);
|
||||
void validateAndAddBeneficiary() async {
|
||||
// First, validate the form fields (account number, confirm account, ifsc, etc.)
|
||||
if (!_formKey.currentState!.validate()) {
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
Navigator.pop(context); // Close the spinner
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(AppLocalizations.of(context).somethingWentWrong)),
|
||||
|
||||
// Ensure beneficiary is validated before proceeding to TPIN
|
||||
if (!_isBeneficiaryValidated) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Please validate beneficiary details first.')),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the beneficiary object without TPIN for now
|
||||
final beneficiaryWithoutTpin = Beneficiary(
|
||||
accountNo: accountNumberController.text.trim(),
|
||||
accountType: accountType,
|
||||
name: nameController.text.trim(),
|
||||
ifscCode: ifscController.text.trim(),
|
||||
bankName: bankNameController.text.trim(),
|
||||
branchName: branchNameController.text.trim(),
|
||||
);
|
||||
|
||||
// Navigate to TPIN screen
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => TransactionPinScreen(
|
||||
onPinCompleted: (pinScreenContext, tpin) async {
|
||||
// Show loading spinner while processing
|
||||
showDialog(
|
||||
context: pinScreenContext,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext ctx) {
|
||||
// ignore: deprecated_member_use
|
||||
return WillPopScope(
|
||||
onWillPop: () async => false,
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
// Create a new Beneficiary object with the TPIN
|
||||
final beneficiaryWithTpin = Beneficiary(
|
||||
accountNo: beneficiaryWithoutTpin.accountNo,
|
||||
accountType: beneficiaryWithoutTpin.accountType,
|
||||
name: beneficiaryWithoutTpin.name,
|
||||
ifscCode: beneficiaryWithoutTpin.ifscCode,
|
||||
bankName: beneficiaryWithoutTpin.bankName,
|
||||
branchName: beneficiaryWithoutTpin.branchName,
|
||||
tpin: tpin,
|
||||
);
|
||||
|
||||
try {
|
||||
final isSuccess =
|
||||
await service.sendForValidation(beneficiaryWithTpin);
|
||||
|
||||
if (pinScreenContext.mounted) {
|
||||
Navigator.pop(pinScreenContext); // Close the spinner
|
||||
Navigator.pushReplacement(
|
||||
pinScreenContext,
|
||||
MaterialPageRoute(
|
||||
builder: (ctx) =>
|
||||
BeneficiaryResultPage(isSuccess: isSuccess),
|
||||
),
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
if (pinScreenContext.mounted) {
|
||||
Navigator.pop(pinScreenContext); // Close the spinner
|
||||
ScaffoldMessenger.of(pinScreenContext).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(e.response?.statusCode == 409
|
||||
? 'Beneficiary already exists'
|
||||
: 'Something went Wrong')),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
if (pinScreenContext.mounted) {
|
||||
Navigator.pop(pinScreenContext); // Close the spinner
|
||||
ScaffoldMessenger.of(pinScreenContext).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
AppLocalizations.of(context).somethingWentWrong)),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -227,7 +221,8 @@ void validateAndAddBeneficiary() async {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).addBeneficiary,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -265,10 +260,11 @@ void validateAndAddBeneficiary() async {
|
||||
context,
|
||||
).accountNumber,
|
||||
// prefixIcon: Icon(Icons.person),
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
fillColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
@@ -282,6 +278,12 @@ void validateAndAddBeneficiary() async {
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
onChanged: (value) {
|
||||
nameController.clear();
|
||||
setState(() {
|
||||
_isBeneficiaryValidated = false;
|
||||
});
|
||||
},
|
||||
validator: (value) {
|
||||
if (value == null || value.length < 10) {
|
||||
return AppLocalizations.of(
|
||||
@@ -300,10 +302,11 @@ void validateAndAddBeneficiary() async {
|
||||
context,
|
||||
).confirmAccountNumber,
|
||||
// prefixIcon: Icon(Icons.person),
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
fillColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
@@ -334,12 +337,17 @@ void validateAndAddBeneficiary() async {
|
||||
// 🔹 IFSC Code Field
|
||||
TextFormField(
|
||||
controller: ifscController,
|
||||
maxLength: 11,
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(11),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).ifscCode,
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
fillColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
@@ -377,7 +385,6 @@ void validateAndAddBeneficiary() async {
|
||||
return null;
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
// 🔹 Bank Name (Disabled)
|
||||
TextFormField(
|
||||
@@ -388,7 +395,8 @@ void validateAndAddBeneficiary() async {
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).dialogBackgroundColor, // disabled color
|
||||
fillColor: Theme.of(context)
|
||||
.dialogBackgroundColor, // disabled color
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
@@ -400,7 +408,6 @@ void validateAndAddBeneficiary() async {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
// 🔹 Branch Name (Disabled)
|
||||
TextFormField(
|
||||
@@ -423,59 +430,63 @@ void validateAndAddBeneficiary() async {
|
||||
),
|
||||
),
|
||||
),
|
||||
//Validate Beneficiary Name
|
||||
if (!_isBeneficiaryValidated)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 12.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _isValidating
|
||||
? null
|
||||
: () {
|
||||
if (
|
||||
confirmAccountNumberController.text ==
|
||||
accountNumberController.text) {
|
||||
_validateBeneficiary();
|
||||
} else {
|
||||
setState(() {
|
||||
_validationError =
|
||||
'Please enter a valid and matching account number.';
|
||||
});
|
||||
}
|
||||
},
|
||||
child: _isValidating
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Text('Validate Beneficiary'),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (!_isBeneficiaryValidated)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _isValidating
|
||||
? null
|
||||
: () {
|
||||
if (confirmAccountNumberController
|
||||
.text ==
|
||||
accountNumberController.text) {
|
||||
_validateBeneficiary();
|
||||
} else {
|
||||
setState(() {
|
||||
_validationError =
|
||||
'Please enter a valid and matching account number.';
|
||||
});
|
||||
}
|
||||
},
|
||||
child: _isValidating
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2),
|
||||
)
|
||||
: Text(AppLocalizations.of(context)
|
||||
.validateBeneficiary),
|
||||
),
|
||||
),
|
||||
),
|
||||
//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,
|
||||
),
|
||||
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
|
||||
DropdownButtonFormField<String>(
|
||||
@@ -485,7 +496,8 @@ if (!_isBeneficiaryValidated)
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
fillColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
@@ -496,18 +508,17 @@ if (!_isBeneficiaryValidated)
|
||||
),
|
||||
),
|
||||
),
|
||||
items:
|
||||
[
|
||||
AppLocalizations.of(context).savings,
|
||||
AppLocalizations.of(context).current,
|
||||
]
|
||||
.map(
|
||||
(type) => DropdownMenuItem(
|
||||
value: type,
|
||||
child: Text(type),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
items: [
|
||||
AppLocalizations.of(context).savings,
|
||||
AppLocalizations.of(context).current,
|
||||
]
|
||||
.map(
|
||||
(type) => DropdownMenuItem(
|
||||
value: type,
|
||||
child: Text(type),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
accountType = value!;
|
||||
@@ -525,7 +536,8 @@ if (!_isBeneficiaryValidated)
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
fillColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
@@ -539,8 +551,8 @@ if (!_isBeneficiaryValidated)
|
||||
textInputAction: TextInputAction.done,
|
||||
validator: (value) =>
|
||||
value == null || value.length != 10
|
||||
? AppLocalizations.of(context).enterValidPhone
|
||||
: null,
|
||||
? AppLocalizations.of(context).enterValidPhone
|
||||
: null,
|
||||
),
|
||||
const SizedBox(height: 35),
|
||||
],
|
||||
@@ -553,13 +565,13 @@ if (!_isBeneficiaryValidated)
|
||||
child: SizedBox(
|
||||
width: 250,
|
||||
child: ElevatedButton(
|
||||
onPressed:
|
||||
validateAndAddBeneficiary,
|
||||
onPressed: validateAndAddBeneficiary,
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Theme.of(context).primaryColorDark,
|
||||
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
child: Text(AppLocalizations.of(context).validateAndAdd),
|
||||
),
|
||||
|
@@ -35,8 +35,8 @@ class _BeneficiaryResultPageState extends State<BeneficiaryResultPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final successAnimation = 'assets/animations/done.json';
|
||||
final errorAnimation = 'assets/animations/error.json';
|
||||
const successAnimation = 'assets/animations/done.json';
|
||||
const errorAnimation = 'assets/animations/error.json';
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: widget.isSuccess ? Colors.green[50] : Colors.red[50],
|
||||
@@ -66,34 +66,35 @@ class _BeneficiaryResultPageState extends State<BeneficiaryResultPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
bottom: 20, // keep it slightly above the very bottom
|
||||
left: 16,
|
||||
right: 16,
|
||||
child: SizedBox(
|
||||
height: 56, // larger button height
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.pushReplacement( // ensures back goes to ScaffoldScreen
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const NavigationScaffold(),
|
||||
Positioned(
|
||||
bottom: 20, // keep it slightly above the very bottom
|
||||
left: 16,
|
||||
right: 16,
|
||||
child: SizedBox(
|
||||
height: 56, // larger button height
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.pushReplacement(
|
||||
// ensures back goes to ScaffoldScreen
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const NavigationScaffold(),
|
||||
),
|
||||
);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
backgroundColor: Theme.of(context).primaryColorDark,
|
||||
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).done,
|
||||
style: const TextStyle(fontSize: 18), // slightly bigger text
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
backgroundColor: Theme.of(context).primaryColorDark,
|
||||
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).done,
|
||||
style: const TextStyle(fontSize: 18), // slightly bigger text
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.isSuccess)
|
||||
Align(
|
||||
alignment: Alignment.topCenter,
|
||||
@@ -112,4 +113,4 @@ Positioned(
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,18 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/data/models/beneficiary.dart';
|
||||
import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
||||
import '../../../data/models/user.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import '../../../di/injection.dart';
|
||||
import 'package:kmobile/api/services/beneficiary_service.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
//import 'package:kmobile/data/models/user.dart';
|
||||
import 'package:kmobile/widgets/bank_logos.dart';
|
||||
|
||||
class ManageBeneficiariesScreen extends StatefulWidget {
|
||||
// final List<User> users;
|
||||
// final int selectedIndex;
|
||||
|
||||
const ManageBeneficiariesScreen({super.key});
|
||||
final String customerName;
|
||||
const ManageBeneficiariesScreen({super.key, required this.customerName});
|
||||
|
||||
@override
|
||||
State<ManageBeneficiariesScreen> createState() =>
|
||||
@@ -21,12 +18,8 @@ class ManageBeneficiariesScreen extends StatefulWidget {
|
||||
|
||||
class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
||||
var service = getIt<BeneficiaryService>();
|
||||
// late User selectedUser = widget.users[widget.selectedIndex];
|
||||
//final BeneficiaryService _service = BeneficiaryService();
|
||||
bool _isLoading = true;
|
||||
int selectedAccountIndex = 0;
|
||||
List<Beneficiary> _beneficiaries = [];
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -37,7 +30,7 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
||||
Future<void> _loadBeneficiaries() async {
|
||||
final data = await service.fetchBeneficiaryList();
|
||||
setState(() {
|
||||
_beneficiaries = data ;
|
||||
_beneficiaries = data;
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
@@ -70,7 +63,8 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
||||
|
||||
Widget _buildBeneficiaryList() {
|
||||
if (_beneficiaries.isEmpty) {
|
||||
return Center(child: Text(AppLocalizations.of(context).noBeneficiaryFound));
|
||||
return Center(
|
||||
child: Text(AppLocalizations.of(context).noBeneficiaryFound));
|
||||
}
|
||||
return ListView.builder(
|
||||
itemCount: _beneficiaries.length,
|
||||
@@ -79,16 +73,21 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
||||
return ListTile(
|
||||
leading: CircleAvatar(
|
||||
radius: 24,
|
||||
backgroundColor: Theme.of(context).primaryColor.withOpacity(0.2),
|
||||
child: Text(
|
||||
item.name.isNotEmpty
|
||||
? item.name[0].toUpperCase()
|
||||
: '?',
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
child: getBankLogo(item.bankName),
|
||||
),
|
||||
title: Text(item.name),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(item.accountNo),
|
||||
if (item.bankName != null && item.bankName!.isNotEmpty)
|
||||
Text(
|
||||
item.bankName!,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
|
||||
),
|
||||
],
|
||||
),
|
||||
title: Text(item.name ?? 'Unknown'),
|
||||
subtitle: Text(item.accountNo ?? 'No account number'),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -96,6 +95,7 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String customerName = widget.customerName;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context).beneficiaries),
|
||||
@@ -108,7 +108,8 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AddBeneficiaryScreen(),
|
||||
builder: (context) =>
|
||||
AddBeneficiaryScreen(customerName: customerName),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -120,4 +121,4 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -64,7 +64,8 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).blockCard,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -94,14 +95,14 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
||||
controller: _cardController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).cardNumber,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -119,14 +120,14 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
||||
controller: _cvvController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).cvv,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -146,15 +147,15 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
||||
onTap: _pickExpiryDate,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).expiryDate,
|
||||
suffixIcon: Icon(Icons.calendar_today),
|
||||
border: OutlineInputBorder(),
|
||||
suffixIcon: const Icon(Icons.calendar_today),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -170,15 +171,15 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
||||
controller: _phoneController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).phone,
|
||||
prefixIcon: Icon(Icons.phone),
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: const Icon(Icons.phone),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -199,7 +200,8 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
child: Text(AppLocalizations.of(context).block),
|
||||
),
|
||||
|
@@ -20,7 +20,8 @@ class _CardManagementScreen extends State<CardManagementScreen> {
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text(
|
||||
AppLocalizations.of(context).cardManagement,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
|
@@ -54,7 +54,8 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).cardDetails,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -84,14 +85,14 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
||||
controller: _cardController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).cardNumber,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -109,14 +110,14 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
||||
controller: _cvvController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).cvv,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -136,15 +137,15 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
||||
onTap: _pickExpiryDate,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).expiryDate,
|
||||
suffixIcon: Icon(Icons.calendar_today),
|
||||
border: OutlineInputBorder(),
|
||||
suffixIcon: const Icon(Icons.calendar_today),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -160,15 +161,15 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
||||
controller: _phoneController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).phone,
|
||||
prefixIcon: Icon(Icons.phone),
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: const Icon(Icons.phone),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -189,7 +190,8 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
child: Text(AppLocalizations.of(context).next),
|
||||
),
|
||||
|
@@ -54,7 +54,8 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).cardPin,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -84,14 +85,14 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).enterNewPin,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -113,14 +114,14 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).enterAgain,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -144,7 +145,8 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
child: Text(AppLocalizations.of(context).submit),
|
||||
),
|
||||
|
@@ -24,7 +24,8 @@ class _ChequeManagementScreen extends State<ChequeManagementScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).chequeManagement,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
|
@@ -26,7 +26,8 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).kMobile,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
@@ -78,7 +79,7 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
||||
'${AppLocalizations.of(context).cif}: ${user.cifNumber ?? 'N/A'}',
|
||||
style: const TextStyle(fontSize: 16, color: Colors.grey),
|
||||
),
|
||||
SizedBox(height: 30),
|
||||
const SizedBox(height: 30),
|
||||
InfoField(
|
||||
label: AppLocalizations.of(context).activeAccounts,
|
||||
value: user.activeAccounts?.toString() ?? '6',
|
||||
@@ -89,8 +90,7 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
||||
),
|
||||
InfoField(
|
||||
label: AppLocalizations.of(context).dateOfBirth,
|
||||
value:
|
||||
(user.dateOfBirth != null &&
|
||||
value: (user.dateOfBirth != null &&
|
||||
user.dateOfBirth!.length == 8)
|
||||
? '${user.dateOfBirth!.substring(0, 2)}-${user.dateOfBirth!.substring(2, 4)}-${user.dateOfBirth!.substring(4, 8)}'
|
||||
: 'N/A',
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'dart:developer';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
@@ -6,6 +7,7 @@ import 'package:kmobile/data/repositories/transaction_repository.dart';
|
||||
import 'package:kmobile/di/injection.dart';
|
||||
import 'package:kmobile/features/accounts/screens/account_info_screen.dart';
|
||||
import 'package:kmobile/features/accounts/screens/account_statement_screen.dart';
|
||||
import 'package:kmobile/features/accounts/screens/transaction_details_screen.dart';
|
||||
import 'package:kmobile/features/auth/controllers/auth_cubit.dart';
|
||||
import 'package:kmobile/features/auth/controllers/auth_state.dart';
|
||||
import 'package:kmobile/features/customer_info/screens/customer_info_screen.dart';
|
||||
@@ -95,7 +97,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
return Shimmer.fromColors(
|
||||
baseColor: Theme.of(context).dialogBackgroundColor,
|
||||
highlightColor: Theme.of(context).dialogBackgroundColor,
|
||||
child: Container(width: 100, height: 32, color: Theme.of(context).scaffoldBackgroundColor),
|
||||
child: Container(
|
||||
width: 100,
|
||||
height: 32,
|
||||
color: Theme.of(context).scaffoldBackgroundColor),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -199,7 +204,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
child: Scaffold(
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
appBar: AppBar(
|
||||
backgroundColor:Theme.of(context).scaffoldBackgroundColor,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text(
|
||||
AppLocalizations.of(context).kconnect,
|
||||
@@ -291,7 +296,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
Text(
|
||||
"${AppLocalizations.of(context).accountNumber}: ",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
color:
|
||||
Theme.of(context).dialogBackgroundColor,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
@@ -300,9 +306,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
dropdownColor: Theme.of(context).primaryColor,
|
||||
underline: const SizedBox(),
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
iconEnabledColor:Theme.of(context).dialogBackgroundColor,
|
||||
iconEnabledColor:
|
||||
Theme.of(context).dialogBackgroundColor,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
color:
|
||||
Theme.of(context).dialogBackgroundColor,
|
||||
fontSize: 14,
|
||||
),
|
||||
items: List.generate(users.length, (index) {
|
||||
@@ -311,7 +319,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
child: Text(
|
||||
users[index].accountNo ?? 'N/A',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
color: Theme.of(context)
|
||||
.dialogBackgroundColor,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
@@ -351,13 +360,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
color: Theme.of(context)
|
||||
.dialogBackgroundColor,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
)
|
||||
: Icon(
|
||||
: Icon(
|
||||
Icons.refresh,
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
color: Theme.of(context)
|
||||
.dialogBackgroundColor,
|
||||
),
|
||||
onPressed: isRefreshing
|
||||
? null
|
||||
@@ -380,7 +391,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
Text(
|
||||
"₹ ",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
color:
|
||||
Theme.of(context).dialogBackgroundColor,
|
||||
fontSize: 40,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
@@ -393,7 +405,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
'0.00'
|
||||
: '********',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
color: Theme.of(context)
|
||||
.dialogBackgroundColor,
|
||||
fontSize: 40,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
@@ -423,7 +436,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
isVisible
|
||||
? Symbols.visibility_lock
|
||||
: Symbols.visibility,
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
color: Theme.of(context)
|
||||
.scaffoldBackgroundColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -473,21 +487,27 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
_buildQuickLink(Symbols.send_money,
|
||||
AppLocalizations.of(context).fundTransfer, () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
FundTransferBeneficiaryScreen(
|
||||
creditAccountNo:
|
||||
users[selectedAccountIndex]
|
||||
.accountNo!,
|
||||
remitterName:
|
||||
users[selectedAccountIndex]
|
||||
.name!)));
|
||||
}, disable: false),
|
||||
_buildQuickLink(
|
||||
Symbols.send_money,
|
||||
AppLocalizations.of(context).fundTransfer,
|
||||
Symbols.server_person,
|
||||
AppLocalizations.of(context).accountInfo,
|
||||
() {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const FundTransferBeneficiaryScreen()));
|
||||
}, disable: true),
|
||||
_buildQuickLink(Symbols.server_person,
|
||||
AppLocalizations.of(context).accountInfo, () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AccountInfoScreen(
|
||||
users: users,
|
||||
selectedIndex: selectedAccountIndex,
|
||||
@@ -496,39 +516,42 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
_buildQuickLink(
|
||||
Symbols.receipt_long,
|
||||
AppLocalizations.of(context).accountStatement,
|
||||
() {
|
||||
Navigator.push(
|
||||
_buildQuickLink(Symbols.receipt_long,
|
||||
AppLocalizations.of(context).accountStatement,
|
||||
() {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AccountStatementScreen(
|
||||
accountNo: users[selectedAccountIndex]
|
||||
.accountNo!,
|
||||
)));
|
||||
}),
|
||||
_buildQuickLink(Symbols.checkbook,
|
||||
AppLocalizations.of(context).handleCheque, () {},
|
||||
disable: true),
|
||||
_buildQuickLink(Icons.group,
|
||||
AppLocalizations.of(context).manageBeneficiary, () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const ManageBeneficiariesScreen()));
|
||||
}, disable: false),
|
||||
_buildQuickLink(Symbols.support_agent,
|
||||
AppLocalizations.of(context).contactUs, () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const EnquiryScreen()));
|
||||
}),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
builder: (context) =>
|
||||
AccountStatementScreen(
|
||||
accountNo: users[selectedAccountIndex]
|
||||
.accountNo!,
|
||||
)));
|
||||
}),
|
||||
_buildQuickLink(Symbols.checkbook,
|
||||
AppLocalizations.of(context).handleCheque, () {},
|
||||
disable: true),
|
||||
_buildQuickLink(Icons.group,
|
||||
AppLocalizations.of(context).manageBeneficiary,
|
||||
() {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
ManageBeneficiariesScreen(
|
||||
customerName: currAccount.name!)));
|
||||
}, disable: false),
|
||||
_buildQuickLink(Symbols.support_agent,
|
||||
AppLocalizations.of(context).contactUs, () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const EnquiryScreen()));
|
||||
}),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
|
||||
// Recent Transactions
|
||||
Text(
|
||||
@@ -549,21 +572,30 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
tx.type == 'CR' ? Colors.green : Colors.red,
|
||||
),
|
||||
title: Text(
|
||||
tx.name != null
|
||||
? (tx.name!.length > 18
|
||||
? tx.name!.substring(0, 20)
|
||||
: tx.name!)
|
||||
: '',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
tx.date ?? '',
|
||||
style: const TextStyle(fontSize: 15),
|
||||
),
|
||||
subtitle: Text(
|
||||
tx.date ?? '',
|
||||
tx.name != null
|
||||
? (tx.name!.length > 18
|
||||
? tx.name!.substring(0, 22)
|
||||
: tx.name!)
|
||||
: '',
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
trailing: Text(
|
||||
"₹${tx.amount}",
|
||||
style: const TextStyle(fontSize: 16),
|
||||
style: const TextStyle(fontSize: 17),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) =>
|
||||
TransactionDetailsScreen(transaction: tx),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
else
|
||||
@@ -599,17 +631,25 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
leading: Shimmer.fromColors(
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: CircleAvatar(radius: 12, backgroundColor: Theme.of(context).scaffoldBackgroundColor),
|
||||
child: CircleAvatar(
|
||||
radius: 12,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor),
|
||||
),
|
||||
title: Shimmer.fromColors(
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: Container(height: 10, width: 100, color: Theme.of(context).scaffoldBackgroundColor),
|
||||
child: Container(
|
||||
height: 10,
|
||||
width: 100,
|
||||
color: Theme.of(context).scaffoldBackgroundColor),
|
||||
),
|
||||
subtitle: Shimmer.fromColors(
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: Container(height: 8, width: 60, color: Theme.of(context).scaffoldBackgroundColor),
|
||||
child: Container(
|
||||
height: 8,
|
||||
width: 60,
|
||||
color: Theme.of(context).scaffoldBackgroundColor),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
@@ -13,14 +13,7 @@ class AccountCard extends StatelessWidget {
|
||||
width: 300,
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
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),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -56,12 +49,13 @@ class AccountCard extends StatelessWidget {
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
account.accountNumber,
|
||||
style: TextStyle(color: Theme.of(context).dialogBackgroundColor, fontSize: 16),
|
||||
style: TextStyle(
|
||||
color: const DialogThemeData().backgroundColor, fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
'${account.currency} ${account.balance.toStringAsFixed(2)}',
|
||||
style: TextStyle(
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -70,7 +64,8 @@ class AccountCard extends StatelessWidget {
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context).availableBalance,
|
||||
style: TextStyle(color: Theme.of(context).dialogBackgroundColor, fontSize: 12),
|
||||
style: TextStyle(
|
||||
color: const DialogThemeData().backgroundColor, fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@@ -4,7 +4,7 @@ import '../../transactions/models/transaction.dart';
|
||||
|
||||
class TransactionListItem extends StatelessWidget {
|
||||
final Transaction transaction;
|
||||
|
||||
|
||||
const TransactionListItem({
|
||||
super.key,
|
||||
required this.transaction,
|
||||
@@ -13,7 +13,7 @@ class TransactionListItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bool isIncome = transaction.amount > 0;
|
||||
|
||||
|
||||
return Card(
|
||||
elevation: 0,
|
||||
margin: const EdgeInsets.symmetric(vertical: 8),
|
||||
@@ -25,7 +25,8 @@ class TransactionListItem extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: _getCategoryColor(transaction.category).withAlpha((0.1 * 255).toInt()),
|
||||
color: _getCategoryColor(transaction.category)
|
||||
.withAlpha((0.1 * 255).toInt()),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
@@ -34,7 +35,7 @@ class TransactionListItem extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
|
||||
|
||||
// Transaction details
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -48,7 +49,8 @@ class TransactionListItem extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
DateFormat('MMM dd, yyyy • h:mm a').format(transaction.date),
|
||||
DateFormat('MMM dd, yyyy • h:mm a')
|
||||
.format(transaction.date),
|
||||
style: TextStyle(
|
||||
color: Colors.grey[600],
|
||||
fontSize: 12,
|
||||
@@ -57,7 +59,7 @@ class TransactionListItem extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
// Amount
|
||||
Text(
|
||||
'${isIncome ? '+' : ''}${transaction.amount.toStringAsFixed(2)} USD',
|
||||
@@ -106,4 +108,4 @@ class TransactionListItem extends StatelessWidget {
|
||||
return Icons.category;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
@@ -38,12 +40,15 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
||||
const SizedBox(height: 4),
|
||||
GestureDetector(
|
||||
onTap: () => _launchEmailAddress(email),
|
||||
child: Text(email, style: TextStyle(color: Theme.of(context).primaryColor)),
|
||||
child: Text(email,
|
||||
style: TextStyle(color: Theme.of(context).primaryColor)),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
GestureDetector(
|
||||
onTap: () => _launchPhoneNumber(phone),
|
||||
child: Text(phone, style: TextStyle(color: Theme.of(context).scaffoldBackgroundColor)),
|
||||
child: Text(phone,
|
||||
style:
|
||||
TextStyle(color: Theme.of(context).scaffoldBackgroundColor)),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -61,7 +66,8 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).enquiry,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -89,7 +95,7 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
AppLocalizations.of(context).writeToUs,
|
||||
style: TextStyle(color: Colors.grey),
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
@@ -97,7 +103,7 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
||||
style: TextStyle(color: Theme.of(context).primaryColor),
|
||||
),
|
||||
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
AppLocalizations.of(context).keyContacts,
|
||||
style: TextStyle(
|
||||
|
@@ -0,0 +1,409 @@
|
||||
// ignore_for_file: avoid_print, use_build_context_synchronously, duplicate_ignore
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/api/services/neft_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/neft_transaction.dart';
|
||||
import 'package:kmobile/data/models/payment_response.dart';
|
||||
import 'package:kmobile/data/models/rtgs_transaction.dart';
|
||||
import 'package:kmobile/di/injection.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/payment_animation.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
enum TransactionMode { neft, rtgs, imps }
|
||||
|
||||
class FundTransferAmountScreen extends StatefulWidget {
|
||||
final String debitAccountNo;
|
||||
final Beneficiary creditBeneficiary;
|
||||
final String remitterName;
|
||||
|
||||
const FundTransferAmountScreen({
|
||||
super.key,
|
||||
required this.debitAccountNo,
|
||||
required this.creditBeneficiary,
|
||||
required this.remitterName,
|
||||
});
|
||||
|
||||
@override
|
||||
State<FundTransferAmountScreen> createState() =>
|
||||
_FundTransferAmountScreenState();
|
||||
}
|
||||
|
||||
class _FundTransferAmountScreenState extends State<FundTransferAmountScreen> {
|
||||
final _amountController = TextEditingController();
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
TransactionMode _selectedMode = TransactionMode.neft;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_amountController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _onProceed() {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
final amount = double.tryParse(_amountController.text) ?? 0;
|
||||
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
//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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(loc.fundTransfer),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Debit Account (User)
|
||||
Text(
|
||||
loc.debitFrom,
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
Card(
|
||||
elevation: 0,
|
||||
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: ListTile(
|
||||
leading: Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 40,
|
||||
height: 40,
|
||||
),
|
||||
title: Text(widget.remitterName),
|
||||
subtitle: Text(widget.debitAccountNo),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Credit Account (Beneficiary)
|
||||
Text(
|
||||
AppLocalizations.of(context).creditedTo,
|
||||
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),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Transaction Mode Selection
|
||||
Text(
|
||||
AppLocalizations.of(context).selectTransactionType,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).cardColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
),
|
||||
child: ToggleButtons(
|
||||
isSelected: [
|
||||
_selectedMode == TransactionMode.neft,
|
||||
_selectedMode == TransactionMode.rtgs,
|
||||
_selectedMode == TransactionMode.imps,
|
||||
],
|
||||
onPressed: (index) {
|
||||
setState(() {
|
||||
_selectedMode = TransactionMode.values[index];
|
||||
});
|
||||
},
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
selectedColor: Theme.of(context).colorScheme.onPrimary,
|
||||
fillColor: Theme.of(context).primaryColor,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
borderColor: Colors.transparent,
|
||||
selectedBorderColor: Colors.transparent,
|
||||
splashColor: Theme.of(context).primaryColor.withOpacity(0.1),
|
||||
highlightColor:
|
||||
Theme.of(context).primaryColor.withOpacity(0.05),
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 24.0, vertical: 12.0),
|
||||
child: Text(AppLocalizations.of(context).neft),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 24.0, vertical: 12.0),
|
||||
child: Text(AppLocalizations.of(context).rtgs),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 24.0, vertical: 12.0),
|
||||
child: Text(AppLocalizations.of(context).imps),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 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),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,113 +1,26 @@
|
||||
/*import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
// import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_screen.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
class FundTransferBeneficiaryScreen extends StatefulWidget {
|
||||
const FundTransferBeneficiaryScreen({super.key});
|
||||
|
||||
@override
|
||||
State<FundTransferBeneficiaryScreen> createState() =>
|
||||
_FundTransferBeneficiaryScreen();
|
||||
}
|
||||
|
||||
class _FundTransferBeneficiaryScreen
|
||||
extends State<FundTransferBeneficiaryScreen> {
|
||||
final List<Map<String, String>> beneficiaries = [
|
||||
{'bank': 'State Bank Of India', 'name': 'Trina Bakshi'},
|
||||
{'bank': 'State Bank Of India', 'name': 'Sheetal Rao'},
|
||||
{'bank': 'Punjab National Bank', 'name': 'Manoj Kumar'},
|
||||
{'bank': 'State Bank Of India', 'name': 'Rohit Mehra'},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: const Icon(Symbols.arrow_back_ios_new),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).fundTransferBeneficiary,
|
||||
style: 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: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ListView.builder(
|
||||
itemCount: beneficiaries.length,
|
||||
itemBuilder: (context, index) {
|
||||
final beneficiary = beneficiaries[index];
|
||||
return ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
child: Text('A'),
|
||||
),
|
||||
title: Text(beneficiary['name']!),
|
||||
subtitle: Text(beneficiary['bank']!),
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Symbols.arrow_right, size: 20),
|
||||
onPressed: () {
|
||||
// Delete action
|
||||
},
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const FundTransferScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/widgets/bank_logos.dart';
|
||||
import 'package:kmobile/data/models/beneficiary.dart';
|
||||
//import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_amount_screen.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import '../../../di/injection.dart';
|
||||
import 'package:kmobile/api/services/beneficiary_service.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
|
||||
|
||||
class FundTransferBeneficiaryScreen extends StatefulWidget {
|
||||
const FundTransferBeneficiaryScreen({super.key});
|
||||
final String creditAccountNo;
|
||||
final String remitterName;
|
||||
const FundTransferBeneficiaryScreen(
|
||||
{super.key, required this.creditAccountNo, required this.remitterName});
|
||||
|
||||
@override
|
||||
State<FundTransferBeneficiaryScreen> createState() =>
|
||||
_ManageBeneficiariesScreen();
|
||||
_FundTransferBeneficiaryScreenState();
|
||||
}
|
||||
|
||||
class _ManageBeneficiariesScreen extends State<FundTransferBeneficiaryScreen> {
|
||||
class _FundTransferBeneficiaryScreenState
|
||||
extends State<FundTransferBeneficiaryScreen> {
|
||||
var service = getIt<BeneficiaryService>();
|
||||
//final BeneficiaryService _service = BeneficiaryService();
|
||||
bool _isLoading = true;
|
||||
List<Beneficiary> _beneficiaries = [];
|
||||
|
||||
@@ -120,7 +33,7 @@ class _ManageBeneficiariesScreen extends State<FundTransferBeneficiaryScreen> {
|
||||
Future<void> _loadBeneficiaries() async {
|
||||
final data = await service.fetchBeneficiaryList();
|
||||
setState(() {
|
||||
_beneficiaries = data ;
|
||||
_beneficiaries = data;
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
@@ -132,7 +45,7 @@ class _ManageBeneficiariesScreen extends State<FundTransferBeneficiaryScreen> {
|
||||
baseColor: Colors.grey.shade300,
|
||||
highlightColor: Colors.grey.shade100,
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
leading: const CircleAvatar(
|
||||
radius: 24,
|
||||
backgroundColor: Colors.white,
|
||||
),
|
||||
@@ -153,25 +66,44 @@ class _ManageBeneficiariesScreen extends State<FundTransferBeneficiaryScreen> {
|
||||
|
||||
Widget _buildBeneficiaryList() {
|
||||
if (_beneficiaries.isEmpty) {
|
||||
return Center(child: Text(AppLocalizations.of(context).noBeneficiaryFound));
|
||||
return Center(
|
||||
child: Text(AppLocalizations.of(context).noBeneficiaryFound));
|
||||
}
|
||||
return ListView.builder(
|
||||
itemCount: _beneficiaries.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = _beneficiaries[index];
|
||||
final beneficiary = _beneficiaries[index];
|
||||
return ListTile(
|
||||
leading: CircleAvatar(
|
||||
radius: 24,
|
||||
backgroundColor: Theme.of(context).primaryColor.withOpacity(0.2),
|
||||
child: Text(
|
||||
item.name.isNotEmpty
|
||||
? item.name[0].toUpperCase()
|
||||
: '?',
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
child: getBankLogo(beneficiary.bankName),
|
||||
),
|
||||
title: Text(item.name ?? 'Unknown'),
|
||||
subtitle: Text(item.accountNo ?? 'No account number'),
|
||||
title: Text(beneficiary.name),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(beneficiary.accountNo),
|
||||
if (beneficiary.bankName != null &&
|
||||
beneficiary.bankName!.isNotEmpty)
|
||||
Text(
|
||||
beneficiary.bankName!,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => FundTransferAmountScreen(
|
||||
debitAccountNo: widget.creditAccountNo,
|
||||
creditBeneficiary: beneficiary,
|
||||
remitterName: widget.remitterName,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@@ -87,7 +87,8 @@ class _FundTransferScreen extends State<FundTransferScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).fundTransfer,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: const [
|
||||
@@ -108,7 +109,7 @@ class _FundTransferScreen extends State<FundTransferScreen> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(AppLocalizations.of(context).debitFrom),
|
||||
Text(
|
||||
const Text(
|
||||
'0300015678903456',
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
||||
),
|
||||
@@ -117,7 +118,7 @@ class _FundTransferScreen extends State<FundTransferScreen> {
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
AppLocalizations.of(context).enterAmount,
|
||||
style: TextStyle(fontSize: 20),
|
||||
style: const TextStyle(fontSize: 20),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui' as ui;
|
||||
@@ -10,222 +11,6 @@ import 'package:path_provider/path_provider.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import 'package:confetti/confetti.dart';
|
||||
|
||||
/*class PaymentAnimationScreen extends StatefulWidget {
|
||||
final Future<PaymentResponse> paymentResponse;
|
||||
|
||||
const PaymentAnimationScreen({super.key, required this.paymentResponse});
|
||||
|
||||
@override
|
||||
State<PaymentAnimationScreen> createState() => _PaymentAnimationScreenState();
|
||||
}
|
||||
|
||||
class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
||||
final GlobalKey _shareKey = GlobalKey();
|
||||
|
||||
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',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: FutureBuilder<PaymentResponse>(
|
||||
future: widget.paymentResponse,
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return Center(
|
||||
child: Lottie.asset(
|
||||
'assets/animations/rupee.json',
|
||||
width: 200,
|
||||
height: 200,
|
||||
repeat: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final response = snapshot.data!;
|
||||
final isSuccess = response.isSuccess;
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: RepaintBoundary(
|
||||
key: _shareKey,
|
||||
child: Container(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 80),
|
||||
Lottie.asset(
|
||||
isSuccess
|
||||
? 'assets/animations/done.json'
|
||||
: 'assets/animations/error.json',
|
||||
width: 200,
|
||||
height: 200,
|
||||
repeat: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
isSuccess
|
||||
? Column(
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(
|
||||
context,
|
||||
).paymentSuccessful,
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.green,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (response.amount != null)
|
||||
Text(
|
||||
'${AppLocalizations.of(context).amount}: ${response.amount} ${response.currency ?? ''}',
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontFamily: 'Rubik',
|
||||
),
|
||||
),
|
||||
if (response.creditedAccount != null)
|
||||
Text(
|
||||
'${AppLocalizations.of(context).creditedAccount}: ${response.creditedAccount}',
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: 'Rubik',
|
||||
),
|
||||
),
|
||||
if (response.date != null)
|
||||
Text(
|
||||
'Date: ${response.date!.toLocal().toIso8601String()}',
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).paymentFailed,
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (response.errorMessage != null)
|
||||
Text(
|
||||
response.errorMessage!,
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Buttons at the bottom
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 80,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
Navigator.of(
|
||||
context,
|
||||
).popUntil((route) => route.isFirst);
|
||||
},
|
||||
label: Text(AppLocalizations.of(context).done),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 45,
|
||||
vertical: 12,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
textStyle: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}*/
|
||||
|
||||
class PaymentAnimationScreen extends StatefulWidget {
|
||||
final Future<PaymentResponse> paymentResponse;
|
||||
|
||||
@@ -242,7 +27,8 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_confettiController = ConfettiController(duration: const Duration(seconds: 2));
|
||||
_confettiController =
|
||||
ConfettiController(duration: const Duration(seconds: 2));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -256,7 +42,8 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
||||
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);
|
||||
ByteData? byteData =
|
||||
await image.toByteData(format: ui.ImageByteFormat.png);
|
||||
Uint8List pngBytes = byteData!.buffer.asUint8List();
|
||||
|
||||
final tempDir = await getTemporaryDirectory();
|
||||
@@ -344,7 +131,8 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
||||
? Column(
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).paymentSuccessful,
|
||||
AppLocalizations.of(context)
|
||||
.paymentSuccessful,
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -375,6 +163,15 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
||||
"Date: ${response.date!.toLocal().toIso8601String()}",
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
if (response.utr != null &&
|
||||
response.utr!.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Text(
|
||||
'UTR: ${response.utr}',
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Column(
|
||||
@@ -390,7 +187,7 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
||||
const SizedBox(height: 16),
|
||||
if (response.errorMessage != null)
|
||||
Text(
|
||||
response.errorMessage!,
|
||||
response.errorMessage ?? '',
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
],
|
||||
@@ -419,10 +216,13 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
||||
style: TextStyle(color: Theme.of(context).primaryColor),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 12),
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 32, vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(color: Theme.of(context).primaryColor, width: 1),
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).primaryColor, width: 1),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
textStyle: const TextStyle(
|
||||
@@ -434,12 +234,14 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
Navigator.of(context)
|
||||
.popUntil((route) => route.isFirst);
|
||||
},
|
||||
icon: const Icon(Icons.check),
|
||||
label: Text(AppLocalizations.of(context).done),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 45, vertical: 12),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 45, vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/tpin_set_screen.dart';
|
||||
|
||||
@@ -132,7 +131,8 @@ class _TpinOtpScreenState extends State<TpinOtpScreen> {
|
||||
icon: const Icon(Icons.verified_user_rounded),
|
||||
label: Text(
|
||||
AppLocalizations.of(context).verifyOtp,
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
|
||||
style: const TextStyle(
|
||||
fontSize: 18, fontWeight: FontWeight.w600),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: theme.colorScheme.primary,
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/tpin_otp_screen.dart';
|
||||
|
||||
@@ -42,7 +41,8 @@ class TpinSetupPromptScreen extends StatelessWidget {
|
||||
icon: const Icon(Icons.arrow_forward_rounded),
|
||||
label: Text(
|
||||
AppLocalizations.of(context).setTpin,
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
|
||||
style:
|
||||
const TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: theme.colorScheme.primary,
|
||||
|
@@ -55,6 +55,7 @@ class _TpinSetScreenState extends State<TpinSetScreen> {
|
||||
await authService.setTpin(pin);
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
// ignore: unnecessary_string_interpolations
|
||||
_errorText = "${AppLocalizations.of(context).tpinFailed}";
|
||||
_tpin.clear();
|
||||
});
|
||||
@@ -71,11 +72,11 @@ class _TpinSetScreenState extends State<TpinSetScreen> {
|
||||
),
|
||||
title: Column(
|
||||
children: [
|
||||
Icon(Icons.check_circle, color: Colors.green, size: 60),
|
||||
SizedBox(height: 12),
|
||||
const Icon(Icons.check_circle, color: Colors.green, size: 60),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
AppLocalizations.of(context).success,
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -90,7 +91,7 @@ class _TpinSetScreenState extends State<TpinSetScreen> {
|
||||
},
|
||||
child: Text(
|
||||
AppLocalizations.of(context).ok,
|
||||
style: TextStyle(fontSize: 16),
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -172,7 +173,9 @@ class _TpinSetScreenState extends State<TpinSetScreen> {
|
||||
key == '<' ? '⌫' : key,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: key == 'Enter' ? Theme.of(context).primaryColor : Colors.black,
|
||||
color: key == 'Enter'
|
||||
? Theme.of(context).primaryColor
|
||||
: Colors.black,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -201,7 +204,8 @@ class _TpinSetScreenState extends State<TpinSetScreen> {
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Icon(Icons.lock_outline, size: 60, color: Theme.of(context).primaryColor),
|
||||
Icon(Icons.lock_outline,
|
||||
size: 60, color: Theme.of(context).primaryColor),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
getTitle(),
|
||||
|
@@ -1,27 +1,24 @@
|
||||
// ignore_for_file: unused_field
|
||||
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/api/services/auth_service.dart';
|
||||
import 'package:kmobile/api/services/payment_service.dart';
|
||||
import 'package:kmobile/data/models/transfer.dart';
|
||||
import 'package:kmobile/di/injection.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/payment_animation.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';
|
||||
|
||||
class TransactionPinScreen extends StatefulWidget {
|
||||
final Transfer transactionData;
|
||||
const TransactionPinScreen({super.key, required this.transactionData});
|
||||
final Future<void> Function(BuildContext, String) onPinCompleted;
|
||||
|
||||
const TransactionPinScreen({super.key, required this.onPinCompleted});
|
||||
|
||||
@override
|
||||
State<TransactionPinScreen> createState() => _TransactionPinScreen();
|
||||
State<TransactionPinScreen> createState() => _TransactionPinScreenState();
|
||||
}
|
||||
|
||||
class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
class _TransactionPinScreenState extends State<TransactionPinScreen> {
|
||||
final List<String> _pin = [];
|
||||
bool _loading = true;
|
||||
bool _isSubmitting = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -55,6 +52,7 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
}
|
||||
|
||||
void _onKeyPressed(String value) {
|
||||
if (_isSubmitting) return;
|
||||
setState(() {
|
||||
if (value == 'back') {
|
||||
if (_pin.isNotEmpty) _pin.removeLast();
|
||||
@@ -64,6 +62,27 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _submitPin() async {
|
||||
if (_isSubmitting) return;
|
||||
|
||||
if (_pin.length == 6) {
|
||||
setState(() => _isSubmitting = true);
|
||||
try {
|
||||
await widget.onPinCompleted(context, _pin.join());
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => _isSubmitting = false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context).enter6DigitTpin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildPinIndicators() {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -75,7 +94,9 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Theme.of(context).primaryColor, width: 2),
|
||||
color: index < _pin.length ? Theme.of(context).primaryColor : Colors.transparent,
|
||||
color: index < _pin.length
|
||||
? Theme.of(context).primaryColor
|
||||
: Colors.transparent,
|
||||
),
|
||||
);
|
||||
}),
|
||||
@@ -85,30 +106,15 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
Widget _buildKey(String label, {IconData? icon}) {
|
||||
return Expanded(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
if (label == 'back') {
|
||||
_onKeyPressed('back');
|
||||
} else if (label == 'done') {
|
||||
// Handle submit if needed
|
||||
if (_pin.length == 6) {
|
||||
await sendTransaction();
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context).enter6DigitTpin),
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
_onKeyPressed(label);
|
||||
}
|
||||
},
|
||||
onTap: () => label == 'done' ? _submitPin() : _onKeyPressed(label),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
child: Center(
|
||||
child: icon != null
|
||||
? Icon(icon, size: 28)
|
||||
: Text(label, style: const TextStyle(fontSize: 24)),
|
||||
child: _isSubmitting && label == 'done'
|
||||
? const CircularProgressIndicator()
|
||||
: icon != null
|
||||
? Icon(icon, size: 28)
|
||||
: Text(label, style: const TextStyle(fontSize: 24)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -133,30 +139,6 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> sendTransaction() async {
|
||||
final paymentService = getIt<PaymentService>();
|
||||
final transfer = widget.transactionData;
|
||||
transfer.tpin = _pin.join();
|
||||
try {
|
||||
final paymentResponse = paymentService.processQuickPayWithinBank(
|
||||
transfer,
|
||||
);
|
||||
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) =>
|
||||
PaymentAnimationScreen(paymentResponse: paymentResponse),
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text(e.toString())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -169,26 +151,29 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).tpin,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Text(
|
||||
AppLocalizations.of(context).enterTpin,
|
||||
style: TextStyle(fontSize: 18),
|
||||
body: _loading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Text(
|
||||
AppLocalizations.of(context).enterTpin,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
_buildPinIndicators(),
|
||||
const Spacer(),
|
||||
_buildKeypad(),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
_buildPinIndicators(),
|
||||
const Spacer(),
|
||||
_buildKeypad(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -36,8 +36,8 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final String transactionDate = DateTime.now().toLocal().toString().split(
|
||||
' ',
|
||||
)[0];
|
||||
' ',
|
||||
)[0];
|
||||
final String creditAccount = widget.creditAccount;
|
||||
|
||||
return Scaffold(
|
||||
@@ -53,12 +53,15 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
|
||||
CircleAvatar(
|
||||
radius: 50,
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
child: Icon(Icons.check, color: Theme.of(context).scaffoldBackgroundColor, size: 60),
|
||||
child: Icon(Icons.check,
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
size: 60),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
AppLocalizations.of(context).transactionSuccess,
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
|
||||
style: const TextStyle(
|
||||
fontSize: 18, fontWeight: FontWeight.w600),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
@@ -92,7 +95,8 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Theme.of(context).primaryColorLight,
|
||||
side: const BorderSide(color: Colors.black, width: 1),
|
||||
elevation: 0,
|
||||
@@ -115,7 +119,8 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: Theme.of(context).primaryColorDark,
|
||||
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
child: Text(AppLocalizations.of(context).done),
|
||||
),
|
||||
|
@@ -20,22 +20,22 @@ class ColorThemeDialog extends StatelessWidget {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const CircleAvatar(backgroundColor: Colors.green),
|
||||
// title: const Text('Green'),
|
||||
// onTap: () {
|
||||
// context.read<ThemeCubit>().changeTheme(ThemeType.green);
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// ),
|
||||
// ListTile(
|
||||
// leading: const CircleAvatar(backgroundColor: Colors.orange),
|
||||
// title: const Text('Orange'),
|
||||
// onTap: () {
|
||||
// context.read<ThemeCubit>().changeTheme(ThemeType.orange);
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// ),
|
||||
ListTile(
|
||||
leading: const CircleAvatar(backgroundColor: Colors.green),
|
||||
title: const Text('Green'),
|
||||
onTap: () {
|
||||
context.read<ThemeCubit>().changeTheme(ThemeType.green);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const CircleAvatar(backgroundColor: Colors.orange),
|
||||
title: const Text('Orange'),
|
||||
onTap: () {
|
||||
context.read<ThemeCubit>().changeTheme(ThemeType.orange);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const CircleAvatar(backgroundColor: Colors.blue),
|
||||
title: Text(AppLocalizations.of(context).blue),
|
||||
@@ -48,4 +48,3 @@ class ColorThemeDialog extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,9 +1,12 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import 'package:kmobile/app.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class LanguageDialog extends StatelessWidget {
|
||||
// ignore: use_super_parameters
|
||||
const LanguageDialog({Key? key}) : super(key: key);
|
||||
|
||||
Future<void> _setLocale(BuildContext context, String langCode) async {
|
||||
@@ -34,4 +37,4 @@ class LanguageDialog extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -21,28 +21,6 @@ class PreferenceScreen extends StatelessWidget {
|
||||
builder: (context, state) {
|
||||
return ListView(
|
||||
children: [
|
||||
// Theme Mode Switch (Light/Dark)
|
||||
// ListTile(
|
||||
// leading: const Icon(Icons.brightness_6),
|
||||
// title: const Text("Theme Mode"),
|
||||
// trailing: Switch(
|
||||
// value: state.isDarkMode,
|
||||
// onChanged: (val) {
|
||||
// context.read<ThemeCubit>().toggleDarkMode(val);
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
//Color_Theme_Selection
|
||||
ListTile(
|
||||
leading: const Icon(Icons.color_lens),
|
||||
title: Text(AppLocalizations.of(context).themeColor),
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => const ColorThemeDialog(),
|
||||
);
|
||||
}
|
||||
),
|
||||
// Language Selection
|
||||
ListTile(
|
||||
leading: const Icon(Icons.language),
|
||||
@@ -50,14 +28,38 @@ class PreferenceScreen extends StatelessWidget {
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => const LanguageDialog(), // your custom language dialog
|
||||
builder: (_) =>
|
||||
const LanguageDialog(), // your custom language dialog
|
||||
);
|
||||
},
|
||||
),
|
||||
//Theme Mode Switch (Light/Dark)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.brightness_6),
|
||||
title: Text(AppLocalizations.of(context).themeMode),
|
||||
enabled: false,
|
||||
//trailing: Switch(
|
||||
// value: state.isDarkMode,
|
||||
// onChanged: (val) {
|
||||
// context.read<ThemeCubit>().toggleDarkMode(val);
|
||||
// },
|
||||
//),
|
||||
),
|
||||
//Color_Theme_Selection
|
||||
ListTile(
|
||||
leading: const Icon(Icons.color_lens),
|
||||
title: Text(AppLocalizations.of(context).themeColor),
|
||||
//enabled: false,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => const ColorThemeDialog(),
|
||||
);
|
||||
}),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,8 @@ class ProfileScreen extends StatelessWidget {
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const PreferenceScreen()),
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const PreferenceScreen()),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@@ -1,9 +1,23 @@
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'dart:async';
|
||||
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/rtgs_service.dart';
|
||||
import 'package:kmobile/data/models/imps_transaction.dart';
|
||||
import 'package:kmobile/data/models/neft_transaction.dart';
|
||||
import 'package:kmobile/data/models/payment_response.dart';
|
||||
import 'package:kmobile/data/models/rtgs_transaction.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/payment_animation.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_swipe_button/flutter_swipe_button.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
import '../../../../di/injection.dart';
|
||||
import '../../../../api/services/beneficiary_service.dart';
|
||||
|
||||
class QuickPayOutsideBankScreen extends StatefulWidget {
|
||||
final String debitAccount;
|
||||
@@ -26,9 +40,12 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
final ifscController = TextEditingController();
|
||||
final phoneController = TextEditingController();
|
||||
final amountController = TextEditingController();
|
||||
final service = getIt<BeneficiaryService>();
|
||||
|
||||
//String accountType = 'Savings';
|
||||
late String accountType;
|
||||
bool _isValidating = false;
|
||||
bool _isBeneficiaryValidated = false;
|
||||
String? _validationError;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -40,7 +57,67 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
//final List<String> transactionModes = ['NEFT', 'RTGS', 'IMPS'];
|
||||
void _validateIFSC() async {
|
||||
final ifsc = ifscController.text.trim().toUpperCase();
|
||||
if (ifsc.isEmpty) return;
|
||||
|
||||
final result = await service.validateIFSC(ifsc);
|
||||
|
||||
if (mounted) {
|
||||
if (result.bankName == '') {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(AppLocalizations.of(context).invalidIfsc)),
|
||||
);
|
||||
bankNameController.clear();
|
||||
branchNameController.clear();
|
||||
} else {
|
||||
bankNameController.text = result.bankName;
|
||||
branchNameController.text = result.branchName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _validateBeneficiary() async {
|
||||
FocusScope.of(context).unfocus();
|
||||
setState(() {
|
||||
_isValidating = true;
|
||||
_validationError = null;
|
||||
_isBeneficiaryValidated = false;
|
||||
nameController.text = ''; // clear previous name
|
||||
});
|
||||
|
||||
final String accountNo = accountNumberController.text.trim();
|
||||
final String ifsc = ifscController.text.trim();
|
||||
// ignore: prefer_const_declarations
|
||||
final String remitter = "Unknown";
|
||||
|
||||
final service = getIt<BeneficiaryService>();
|
||||
try {
|
||||
final String beneficiaryName = await service.validateBeneficiary(
|
||||
accountNo: accountNo,
|
||||
ifscCode: ifsc,
|
||||
remitterName: remitter,
|
||||
);
|
||||
|
||||
setState(() {
|
||||
nameController.text = beneficiaryName;
|
||||
_isBeneficiaryValidated = true;
|
||||
_validationError = null;
|
||||
});
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
_validationError = e.toString();
|
||||
_isBeneficiaryValidated = false;
|
||||
});
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isValidating = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<String> transactionModes(BuildContext context) {
|
||||
return [
|
||||
AppLocalizations.of(context).neft,
|
||||
@@ -65,6 +142,177 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _onProceedToPay() {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
if (!_isBeneficiaryValidated) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content:
|
||||
Text(AppLocalizations.of(context).plsValidateBeneficiary)),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
final amount = double.tryParse(amountController.text) ?? 0;
|
||||
final selectedMode = transactionModes(context)[selectedTransactionIndex];
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => TransactionPinScreen(
|
||||
onPinCompleted: (pinScreenContext, tpin) async {
|
||||
if (isNeft) {
|
||||
// NEFT
|
||||
final neftTx = NeftTransaction(
|
||||
fromAccount: widget.debitAccount,
|
||||
toAccount: accountNumberController.text,
|
||||
amount: amountController.text,
|
||||
ifscCode: ifscController.text,
|
||||
remitterName: "Unknown",
|
||||
beneficiaryName: nameController.text,
|
||||
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);
|
||||
} catch (e) {
|
||||
final paymentResponse = PaymentResponse(
|
||||
isSuccess: false,
|
||||
errorMessage: e.toString(),
|
||||
);
|
||||
completer.complete(paymentResponse);
|
||||
}
|
||||
}
|
||||
|
||||
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>();
|
||||
|
||||
Navigator.of(pinScreenContext).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => PaymentAnimationScreen(
|
||||
paymentResponse: completer.future),
|
||||
),
|
||||
);
|
||||
|
||||
try {
|
||||
final neftResponse =
|
||||
await impsService.processImpsTransaction(impsTx);
|
||||
final paymentResponse = PaymentResponse(
|
||||
isSuccess: neftResponse.message.toUpperCase() == 'SUCCESS',
|
||||
date: DateTime.now(),
|
||||
creditedAccount: impsTx.toAccount,
|
||||
amount: impsTx.amount,
|
||||
currency: 'INR',
|
||||
utr: neftResponse.utr,
|
||||
);
|
||||
completer.complete(paymentResponse);
|
||||
} catch (e) {
|
||||
final paymentResponse = PaymentResponse(
|
||||
isSuccess: false,
|
||||
errorMessage: e.toString(),
|
||||
);
|
||||
completer.complete(paymentResponse);
|
||||
}
|
||||
}
|
||||
|
||||
if (isRtgs) {
|
||||
// RTGS
|
||||
final rtgsTx = RtgsTransaction(
|
||||
fromAccount: widget.debitAccount,
|
||||
toAccount: accountNumberController.text,
|
||||
amount: amountController.text,
|
||||
ifscCode: ifscController.text,
|
||||
remitterName: "Unknown",
|
||||
beneficiaryName: nameController.text,
|
||||
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);
|
||||
} catch (e) {
|
||||
final paymentResponse = PaymentResponse(
|
||||
isSuccess: false,
|
||||
errorMessage: e.toString(),
|
||||
);
|
||||
completer.complete(paymentResponse);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -77,7 +325,8 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).quickPayOutsideBank,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -103,30 +352,35 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
child: ListView(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Text(AppLocalizations.of(context).debitFrom),
|
||||
Text(
|
||||
widget.debitAccount,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
Text(
|
||||
AppLocalizations.of(context).debitFrom,
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Card(
|
||||
elevation: 0,
|
||||
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: ListTile(
|
||||
leading: Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 40,
|
||||
height: 40,
|
||||
),
|
||||
title: Text(widget.debitAccount),
|
||||
subtitle: Text(AppLocalizations.of(context).ownBank),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).accountNumber,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -134,11 +388,17 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
keyboardType: TextInputType.number,
|
||||
obscureText: true,
|
||||
textInputAction: TextInputAction.next,
|
||||
onChanged: (value) {
|
||||
nameController.clear();
|
||||
setState(() {
|
||||
_isBeneficiaryValidated = false;
|
||||
});
|
||||
},
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return AppLocalizations.of(context).accountNumberRequired;
|
||||
} else if (value.length != 11) {
|
||||
return AppLocalizations.of(context).validAccountNumber;
|
||||
} else if (value.length < 7 || value.length > 20) {
|
||||
return AppLocalizations.of(context).accno7to20;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -149,14 +409,14 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).confirmAccountNumber,
|
||||
// prefixIcon: Icon(Icons.person),
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -173,101 +433,50 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).name,
|
||||
border: OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
controller: nameController,
|
||||
keyboardType: TextInputType.name,
|
||||
textInputAction: TextInputAction.next,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return AppLocalizations.of(context).nameRequired;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).bankName,
|
||||
border: OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
controller: bankNameController,
|
||||
textInputAction: TextInputAction.next,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return AppLocalizations.of(context).bankNameRequired;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).branchName,
|
||||
border: OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
controller: branchNameController,
|
||||
textInputAction: TextInputAction.next,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return AppLocalizations.of(context).branchNameRequired;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
maxLength: 11,
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(11),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).ifscCode,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
controller: ifscController,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
_validateIFSC();
|
||||
},
|
||||
onChanged: (value) {
|
||||
final trimmed = value.trim().toUpperCase();
|
||||
if (trimmed.length < 11) {
|
||||
// clear bank/branch if backspace or changed
|
||||
bankNameController.clear();
|
||||
branchNameController.clear();
|
||||
}
|
||||
},
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return AppLocalizations.of(context).ifscRequired;
|
||||
final pattern = RegExp(r'^[A-Z]{4}0[A-Z0-9]{6}$');
|
||||
if (value == null || value.trim().isEmpty) {
|
||||
return AppLocalizations.of(context).enterIfsc;
|
||||
} else if (!pattern.hasMatch(
|
||||
value.trim().toUpperCase(),
|
||||
)) {
|
||||
return AppLocalizations.of(
|
||||
context,
|
||||
).invalidIfscFormat;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -279,27 +488,25 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
value: accountType,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).accountType,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
items:
|
||||
[
|
||||
AppLocalizations.of(context).savings,
|
||||
AppLocalizations.of(context).current,
|
||||
]
|
||||
.map(
|
||||
(e) =>
|
||||
DropdownMenuItem(value: e, child: Text(e)),
|
||||
)
|
||||
.toList(),
|
||||
items: [
|
||||
AppLocalizations.of(context).savings,
|
||||
AppLocalizations.of(context).current,
|
||||
]
|
||||
.map(
|
||||
(e) => DropdownMenuItem(value: e, child: Text(e)),
|
||||
)
|
||||
.toList(),
|
||||
onChanged: (value) => setState(() {
|
||||
accountType = value!;
|
||||
}),
|
||||
@@ -308,6 +515,111 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
TextFormField(
|
||||
controller: bankNameController,
|
||||
enabled: false,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).bankName,
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).dialogBackgroundColor,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.black,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
TextFormField(
|
||||
controller: branchNameController,
|
||||
enabled: false,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).branchName,
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).dialogBackgroundColor,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.black,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (!_isBeneficiaryValidated)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _isValidating
|
||||
? null
|
||||
: () {
|
||||
if (confirmAccountNumberController.text ==
|
||||
accountNumberController.text) {
|
||||
_validateBeneficiary();
|
||||
} else {
|
||||
setState(() {
|
||||
_validationError =
|
||||
AppLocalizations.of(context)
|
||||
.accountMismatch;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: _isValidating
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: Text(
|
||||
AppLocalizations.of(context).validateBeneficiary),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (_validationError != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24.0),
|
||||
child: Text(
|
||||
_validationError!,
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
controller: nameController,
|
||||
enabled: false,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).name,
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).dialogBackgroundColor,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return AppLocalizations.of(context).nameRequired;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -316,15 +628,15 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
keyboardType: TextInputType.phone,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).phone,
|
||||
prefixIcon: Icon(Icons.phone),
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: const Icon(Icons.phone),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -339,14 +651,14 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
child: TextFormField(
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context).amount,
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||
),
|
||||
),
|
||||
@@ -372,7 +684,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).transactionMode,
|
||||
style: TextStyle(fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: buildTransactionModeSelector()),
|
||||
@@ -382,38 +694,19 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: SwipeButton.expand(
|
||||
thumb: Icon(Icons.arrow_forward, color: Theme.of(context).scaffoldBackgroundColor),
|
||||
activeThumbColor: Theme.of(context).primaryColorDark,
|
||||
activeTrackColor: Theme.of(context).primaryColorLight,
|
||||
thumb: Icon(Icons.arrow_forward,
|
||||
color: Theme.of(context).dialogBackgroundColor),
|
||||
activeThumbColor: Theme.of(context).primaryColor,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.secondary.withAlpha(100),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
height: 56,
|
||||
onSwipe: _onProceedToPay,
|
||||
child: Text(
|
||||
AppLocalizations.of(context).swipeToPay,
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.bold),
|
||||
),
|
||||
onSwipe: () {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
// Perform payment logic
|
||||
final selectedMode = transactionModes(
|
||||
context,
|
||||
)[selectedTransactionIndex];
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'${AppLocalizations.of(context).payingVia} $selectedMode...',
|
||||
),
|
||||
),
|
||||
);
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// const TransactionPinScreen(
|
||||
// transactionData: {},
|
||||
// transactionCode: 'PAYMENT',
|
||||
// )));
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -438,10 +731,14 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
margin: const EdgeInsets.symmetric(horizontal: 4),
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? Theme.of(context).primaryColor : Theme.of(context).scaffoldBackgroundColor,
|
||||
color: isSelected
|
||||
? Theme.of(context).primaryColor
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(
|
||||
color: isSelected ? Theme.of(context).primaryColor : Theme.of(context).scaffoldBackgroundColor,
|
||||
color: isSelected
|
||||
? Theme.of(context).primaryColor
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
width: isSelected ? 0 : 1.2,
|
||||
),
|
||||
),
|
||||
|
@@ -64,7 +64,6 @@ class _QuickPayScreen extends State<QuickPayScreen> {
|
||||
),
|
||||
const Divider(height: 1),
|
||||
QuickPayManagementTile(
|
||||
disable: true,
|
||||
icon: Symbols.output_circle,
|
||||
label: AppLocalizations.of(context).outsideBank,
|
||||
onTap: () {
|
||||
|
@@ -1,13 +1,15 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_swipe_button/flutter_swipe_button.dart';
|
||||
import 'package:kmobile/api/services/beneficiary_service.dart';
|
||||
import 'package:kmobile/api/services/payment_service.dart';
|
||||
import 'package:kmobile/data/models/transfer.dart';
|
||||
import 'package:kmobile/di/injection.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 '../../fund_transfer/screens/transaction_pin_screen.dart';
|
||||
//import 'package:flutter_neumorphic/flutter_neumorphic.dart';
|
||||
|
||||
class QuickPayWithinBankScreen extends StatefulWidget {
|
||||
final String debitAccount;
|
||||
@@ -165,15 +167,6 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
return null;
|
||||
},
|
||||
),
|
||||
// const Align(
|
||||
// alignment: Alignment.topLeft,
|
||||
// child: Padding(
|
||||
// padding: EdgeInsets.only(left: 15.0, top: 5),
|
||||
// child: Text(
|
||||
// 'Beneficiary Account Number',
|
||||
// style: TextStyle(color: Colors.black54),
|
||||
// ),
|
||||
// )),
|
||||
const SizedBox(height: 25),
|
||||
TextFormField(
|
||||
controller: confirmAccountNumberController,
|
||||
@@ -219,7 +212,8 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
} else {
|
||||
setState(() {
|
||||
_validationError =
|
||||
'Please enter a valid and matching account number.';
|
||||
AppLocalizations.of(context)
|
||||
.accountMismatch;
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -229,7 +223,8 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Text('Validate Beneficiary'),
|
||||
: Text(
|
||||
AppLocalizations.of(context).validateBeneficiary),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -241,7 +236,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
const Icon(Icons.check_circle, color: Colors.green),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Beneficiary: $_beneficiaryName',
|
||||
'${AppLocalizations.of(context).beneficiaryName}: $_beneficiaryName',
|
||||
style: const TextStyle(
|
||||
color: Colors.green, fontWeight: FontWeight.bold),
|
||||
),
|
||||
@@ -296,15 +291,6 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
return null;
|
||||
},
|
||||
),
|
||||
// const Align(
|
||||
// alignment: Alignment.topLeft,
|
||||
// child: Padding(
|
||||
// padding: EdgeInsets.only(left: 15.0, top: 5),
|
||||
// child: Text(
|
||||
// 'Beneficiary Account Type',
|
||||
// style: TextStyle(color: Colors.black54),
|
||||
// ),
|
||||
// )),
|
||||
const SizedBox(height: 25),
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
@@ -338,7 +324,8 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: SwipeButton.expand(
|
||||
thumb: Icon(Icons.arrow_forward, color: Theme.of(context).dialogBackgroundColor),
|
||||
thumb: Icon(Icons.arrow_forward,
|
||||
color: Theme.of(context).dialogBackgroundColor),
|
||||
activeThumbColor: Theme.of(context).primaryColor,
|
||||
activeTrackColor: Theme.of(
|
||||
context,
|
||||
@@ -353,8 +340,8 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
if (!_isBeneficiaryValidated) {
|
||||
setState(() {
|
||||
_validationError =
|
||||
'Please validate beneficiary before proceeding.';
|
||||
_validationError = AppLocalizations.of(context)
|
||||
.validateBeneficiaryproceeding;
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -363,12 +350,26 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => TransactionPinScreen(
|
||||
transactionData: Transfer(
|
||||
fromAccount: widget.debitAccount,
|
||||
toAccount: accountNumberController.text,
|
||||
toAccountType: _selectedAccountType!,
|
||||
amount: amountController.text,
|
||||
),
|
||||
onPinCompleted: (pinScreenContext, tpin) async {
|
||||
final transfer = Transfer(
|
||||
fromAccount: widget.debitAccount,
|
||||
toAccount: accountNumberController.text,
|
||||
toAccountType: _selectedAccountType!,
|
||||
amount: amountController.text,
|
||||
tpin: tpin,
|
||||
);
|
||||
|
||||
final paymentService = getIt<PaymentService>();
|
||||
final paymentResponseFuture = paymentService
|
||||
.processQuickPayWithinBank(transfer);
|
||||
|
||||
Navigator.of(pinScreenContext).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => PaymentAnimationScreen(
|
||||
paymentResponse: paymentResponseFuture),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -376,69 +377,6 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
||||
},
|
||||
),
|
||||
),
|
||||
/*Align(
|
||||
alignment: Alignment.center,
|
||||
child: NeumorphicButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
if (!_isBeneficiaryValidated) {
|
||||
setState(() {
|
||||
_validationError =
|
||||
'Please validate beneficiary before proceeding.';
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Perform payment logic
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => TransactionPinScreen(
|
||||
transactionData: Transfer(
|
||||
fromAccount: widget.debitAccount,
|
||||
toAccount: accountNumberController.text,
|
||||
toAccountType: _selectedAccountType!,
|
||||
amount: amountController.text,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
style: NeumorphicStyle(
|
||||
color: Theme.of(context).primaryColor,
|
||||
depth: 4,
|
||||
intensity: 0.8,
|
||||
boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(30)),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).swipeToPay,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),*/
|
||||
// SliderButton(
|
||||
// action: () async {
|
||||
// ///Do something here OnSlide
|
||||
// return true;
|
||||
// },
|
||||
// label: const Text(
|
||||
// "Slide to pay",
|
||||
// style: TextStyle(
|
||||
// color: Color(0xff4a4a4a),
|
||||
// fontWeight: FontWeight.w500,
|
||||
// fontSize: 17),
|
||||
// ),
|
||||
// icon: Icon(Symbols.arrow_forward,
|
||||
// color: Theme.of(context).primaryColor, weight: 200),
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
|
163
lib/features/service/screens/branch_locator_screen.dart
Normal file
@@ -0,0 +1,163 @@
|
||||
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}")),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,3 +1,5 @@
|
||||
import 'package:kmobile/features/service/screens/branch_locator_screen.dart';
|
||||
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -18,7 +20,8 @@ class _ServiceScreen extends State<ServiceScreen> {
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text(
|
||||
AppLocalizations.of(context).services,
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
style:
|
||||
const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
@@ -69,7 +72,12 @@ class _ServiceScreen extends State<ServiceScreen> {
|
||||
ServiceManagementTile(
|
||||
icon: Symbols.missing_controller,
|
||||
label: AppLocalizations.of(context).branchLocator,
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const BranchLocatorScreen()));
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
],
|
||||
|
@@ -4,7 +4,7 @@ class Transaction {
|
||||
final double amount;
|
||||
final DateTime date;
|
||||
final String category;
|
||||
|
||||
|
||||
Transaction({
|
||||
required this.id,
|
||||
required this.description,
|
||||
@@ -12,4 +12,4 @@ class Transaction {
|
||||
required this.date,
|
||||
required this.category,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -229,6 +229,27 @@
|
||||
"beneficiaryAddedSuccess": "Beneficiary Added Successfully",
|
||||
"beneficiaryAdditionFailed": "Beneficiary Addition Failed",
|
||||
"noBeneficiaryFound": "No beneficiaries found",
|
||||
"beneficiaryName": "Beneficiary Name"
|
||||
"beneficiaryName": "Beneficiary Name",
|
||||
"validateBeneficiary": "Validate Beneficiary",
|
||||
"themeMode": "Theme Mode",
|
||||
"transactionDetails": "Transaction Details",
|
||||
"transactionType": "Transaction Type",
|
||||
"transferType": "Transfer Type",
|
||||
"utrNo": "UTR No.",
|
||||
"beneficiaryAccountNo": "Beneficiary Account No.",
|
||||
"invalidRtgs": "Invalid Amount for RTGS",
|
||||
"invalidRtgsPopUp": "RTGS transactions require a minimum amount of 200,000. Please enter a higher amount or select NEFT as the transaction mode.",
|
||||
"correctTpin": "Please Enter the correct TPIN",
|
||||
"insufficientFund": "Your account does not have sufficient balance",
|
||||
"creditedTo": "Credited To",
|
||||
"selectTransactionType": "Select transaction Type",
|
||||
"proceed": "Proceed",
|
||||
"plsValidateBeneficiary": "Please validate beneficiary details first",
|
||||
"accno7to20": "Account number must be between 7 and 20 digits",
|
||||
"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..."
|
||||
}
|
||||
|
||||
|
@@ -229,5 +229,26 @@
|
||||
"beneficiaryAddedSuccess": "लाभार्थी सफलतापूर्वक जोड़ा गया",
|
||||
"beneficiaryAdditionFailed": "लाभार्थी जोड़ने में विफल",
|
||||
"noBeneficiaryFound": "कोई लाभार्थी नहीं मिला",
|
||||
"beneficiaryName": "लाभार्थी नाम"
|
||||
"beneficiaryName": "लाभार्थी नाम",
|
||||
"validateBeneficiary": "लाभार्थी को सत्यापित करें",
|
||||
"themeMode": "थीम मोड",
|
||||
"transactionDetails": "लेन-देन विवरण",
|
||||
"transactionType": "लेनदेन प्रकार",
|
||||
"transferType": "स्थानांतरण प्रकार",
|
||||
"utrNo": "यूटीआर नंबर",
|
||||
"beneficiaryAccountNo": "लाभार्थी खाता संख्या",
|
||||
"invalidRtgs": "RTGS के लिए अमान्य राशि",
|
||||
"invalidRtgsPopUp": "RTGS लेनदेन के लिए न्यूनतम 2,00,000 रुपये की राशि की आवश्यकता होती है। कृपया अधिक राशि दर्ज करें या लेनदेन मोड के रूप में NEFT चुनें",
|
||||
"correctTpin": "कृपया सही टी-पिन दर्ज करें",
|
||||
"insufficientFund": "आपके खाते में पर्याप्त शेष राशि नहीं है",
|
||||
"creditedTo": "को श्रेय दिया गया",
|
||||
"selectTransactionType": "लेन-देन का प्रकार चुनें",
|
||||
"proceed": "आगे बढ़ना",
|
||||
"plsValidateBeneficiary": "कृपया पहले लाभार्थी विवरण सत्यापित करें",
|
||||
"accno7to20": "खाता संख्या सात से बीस अंकों के बीच होनी चाहिए",
|
||||
"validateBeneficiaryproceeding": "कृपया आगे बढ़ने से पहले लाभार्थी को पट्टे पर मान्य करें",
|
||||
"findnearbybranched": "आस-पास की शाखाएँ खोजें",
|
||||
"searchbranch": "शाखा खोजें",
|
||||
"searchbranchby": "शाखा खोजें नाम / बैंक कोड / आईएफएससी द्वारा",
|
||||
"branchsearchsoon": "शाखा खोज सुविधा जल्द ही आ रही है..."
|
||||
}
|
||||
|
@@ -1,664 +0,0 @@
|
||||
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';
|
||||
}
|
@@ -1,664 +0,0 @@
|
||||
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 => 'लाभार्थी नाम';
|
||||
}
|
@@ -13,6 +13,6 @@ void main() async {
|
||||
]);
|
||||
|
||||
// Initialize dependencies
|
||||
await setupDependencies();
|
||||
await setupDependencies();
|
||||
runApp(const KMobile());
|
||||
}
|
||||
|
@@ -3,32 +3,30 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
|
||||
class SecureStorage {
|
||||
final FlutterSecureStorage _storage;
|
||||
|
||||
SecureStorage(): _storage = const FlutterSecureStorage();
|
||||
|
||||
|
||||
SecureStorage() : _storage = const FlutterSecureStorage();
|
||||
|
||||
Future<void> write(String key, dynamic value) async {
|
||||
final stringValue = value is String
|
||||
? value
|
||||
: json.encode(value);
|
||||
final stringValue = value is String ? value : json.encode(value);
|
||||
await _storage.write(key: key, value: stringValue);
|
||||
}
|
||||
|
||||
|
||||
Future<dynamic> read(String key) async {
|
||||
final value = await _storage.read(key: key);
|
||||
if (value == null) return null;
|
||||
|
||||
|
||||
try {
|
||||
return json.decode(value);
|
||||
} catch (_) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<void> delete(String key) async {
|
||||
await _storage.delete(key: key);
|
||||
}
|
||||
|
||||
|
||||
Future<void> deleteAll() async {
|
||||
await _storage.deleteAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
81
lib/widgets/bank_logos.dart
Normal file
@@ -0,0 +1,81 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
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,
|
||||
);
|
||||
}
|
||||
if (bankName != null && bankName.toLowerCase().contains('bank of india')) {
|
||||
return Image.asset(
|
||||
'assets/images/boi_logo.png',
|
||||
width: 40,
|
||||
height: 40,
|
||||
);
|
||||
} else {
|
||||
return const Icon(
|
||||
Icons.account_balance,
|
||||
size: 40,
|
||||
color: Colors.grey,
|
||||
);
|
||||
}
|
||||
}
|
80
pubspec.lock
@@ -21,10 +21,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.11.0"
|
||||
version: "2.13.0"
|
||||
bloc:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -37,10 +37,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
chalkdart:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -53,10 +53,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.4.0"
|
||||
checked_yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -77,18 +77,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.18.0"
|
||||
version: "1.19.1"
|
||||
confetti:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -149,10 +149,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
version: "1.3.3"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -353,10 +353,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.19.0"
|
||||
version: "0.20.2"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -377,18 +377,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
|
||||
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.5"
|
||||
version: "10.0.9"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
|
||||
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.5"
|
||||
version: "3.0.9"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -457,10 +457,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16+1"
|
||||
version: "0.12.17"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -481,10 +481,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
||||
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.16.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -505,10 +505,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.0"
|
||||
version: "1.9.1"
|
||||
path_parsing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -689,15 +689,15 @@ packages:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
version: "0.0.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.10.1"
|
||||
sprintf:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -710,42 +710,42 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
version: "1.12.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.4"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.4.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
version: "1.2.2"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
|
||||
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.2"
|
||||
version: "0.7.4"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -862,10 +862,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
|
||||
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.2.5"
|
||||
version: "15.0.0"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -907,5 +907,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
sdks:
|
||||
dart: ">=3.5.0 <4.0.0"
|
||||
dart: ">=3.7.0-0 <4.0.0"
|
||||
flutter: ">=3.24.0"
|
||||
|
12
pubspec.yaml
@@ -91,6 +91,12 @@ flutter:
|
||||
- assets/images/kccb_logo.svg
|
||||
- assets/images/avatar.jpg
|
||||
- assets/images/logo.png
|
||||
- assets/images/sbi_logo.png
|
||||
- assets/images/axisbank_logo.png
|
||||
- assets/images/BankofBaroda_logo.png
|
||||
- assets/images/canaraBank_logo.png
|
||||
- assets/images/kotak_logo.png
|
||||
- assets/images/boi_logo.png
|
||||
- assets/images/kmobile_splash.jpg
|
||||
- assets/images/kmobile_splash2.png
|
||||
- assets/images/icon.svg
|
||||
@@ -98,9 +104,13 @@ flutter:
|
||||
- assets/images/avatar_male.svg
|
||||
- assets/images/avatar_female.svg
|
||||
- assets/images/kconnect2.webp
|
||||
- assets/images/icici_logo.png
|
||||
- assets/images/hdfc_logo.png
|
||||
- assets/images/pnb_logo.png
|
||||
- assets/animations/rupee.json
|
||||
- assets/animations/error.json
|
||||
- assets/animations/done.json
|
||||
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||
@@ -127,4 +137,4 @@ flutter:
|
||||
flutter_icons:
|
||||
android: true
|
||||
ios: false
|
||||
image_path: assets/images/icon.png
|
||||
image_path: assets/images/icon.png
|
||||
|
@@ -0,0 +1 @@
|
||||
|
||||
|