Compare commits
12 Commits
ee3961215a
...
language-t
Author | SHA1 | Date | |
---|---|---|---|
3024ddef15 | |||
83609fb778 | |||
dbc61abf00 | |||
763c101f58 | |||
117e2d5786 | |||
ae40f61c01 | |||
a1365b19d5 | |||
2dd7f4079b | |||
99e23bf21d | |||
c4d4261afc | |||
|
2fdef7c850 | ||
|
618bd4a9b9 |
@@ -1,4 +1,6 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:kmobile/data/models/ifsc.dart';
|
||||||
|
import 'package:kmobile/data/models/beneficiary.dart';
|
||||||
|
|
||||||
class BeneficiaryService {
|
class BeneficiaryService {
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
@@ -22,4 +24,156 @@ class BeneficiaryService {
|
|||||||
throw Exception('Unexpected error: ${e.toString()}');
|
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);
|
||||||
|
}
|
||||||
|
} 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 null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
///Step 1: Validate beneficiary (returns refNo)
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send Data for Validation
|
||||||
|
Future<void> sendForValidation(Beneficiary beneficiary) async {
|
||||||
|
try {
|
||||||
|
print(beneficiary.toJson());
|
||||||
|
final response = await _dio.post(
|
||||||
|
'/api/beneficiary/add',
|
||||||
|
data: beneficiary.toJson(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
print("SENT FOR VALIDATION");
|
||||||
|
} else {
|
||||||
|
print("VALIDATION REQUEST FAILED: ${response.statusCode}");
|
||||||
|
}
|
||||||
|
} 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{
|
||||||
|
try {
|
||||||
|
final response = await _dio.get(
|
||||||
|
"/api/beneficiary/get",
|
||||||
|
options: Options(
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
return Beneficiary.listFromJson(response.data);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw Exception("Failed to fetch beneficiaries");
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print("Error fetching beneficiaries: $e");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
374
lib/app.dart
374
lib/app.dart
@@ -5,7 +5,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:kmobile/security/secure_storage.dart';
|
import 'package:kmobile/security/secure_storage.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import './l10n/app_localizations.dart';
|
import './l10n/app_localizations.dart';
|
||||||
import 'config/themes.dart';
|
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
||||||
|
import 'package:kmobile/features/auth/controllers/theme_state.dart';
|
||||||
import 'config/routes.dart';
|
import 'config/routes.dart';
|
||||||
import 'di/injection.dart';
|
import 'di/injection.dart';
|
||||||
import 'features/auth/controllers/auth_cubit.dart';
|
import 'features/auth/controllers/auth_cubit.dart';
|
||||||
@@ -16,6 +17,7 @@ import 'features/service/screens/service_screen.dart';
|
|||||||
import 'features/dashboard/screens/dashboard_screen.dart';
|
import 'features/dashboard/screens/dashboard_screen.dart';
|
||||||
import 'features/auth/screens/mpin_screen.dart';
|
import 'features/auth/screens/mpin_screen.dart';
|
||||||
import 'package:local_auth/local_auth.dart';
|
import 'package:local_auth/local_auth.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class KMobile extends StatefulWidget {
|
class KMobile extends StatefulWidget {
|
||||||
const KMobile({super.key});
|
const KMobile({super.key});
|
||||||
@@ -24,27 +26,39 @@ class KMobile extends StatefulWidget {
|
|||||||
State<KMobile> createState() => _KMobileState();
|
State<KMobile> createState() => _KMobileState();
|
||||||
|
|
||||||
static void setLocale(BuildContext context, Locale newLocale) {
|
static void setLocale(BuildContext context, Locale newLocale) {
|
||||||
final _KMobileState? state = context
|
final _KMobileState? state = context.findAncestorStateOfType<_KMobileState>();
|
||||||
.findAncestorStateOfType<_KMobileState>();
|
|
||||||
state?.setLocale(newLocale);
|
state?.setLocale(newLocale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _KMobileState extends State<KMobile> {
|
class _KMobileState extends State<KMobile> {
|
||||||
bool _showSplash = false;
|
bool showSplash = true;
|
||||||
|
Locale? _locale;
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
// Simulate a splash screen delay
|
loadPreferences();
|
||||||
Future.delayed(const Duration(seconds: 2), () {
|
Future.delayed(const Duration(seconds: 2), () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_showSplash = false;
|
showSplash = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Locale? _locale;
|
Future<void> loadPreferences() async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
// Load Locale
|
||||||
|
final String? langCode = prefs.getString('locale');
|
||||||
|
if (langCode != null) {
|
||||||
|
setState(() {
|
||||||
|
_locale = Locale(langCode);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void setLocale(Locale locale) {
|
void setLocale(Locale locale) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -52,89 +66,54 @@ class _KMobileState extends State<KMobile> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@override
|
||||||
@override
|
Widget build(BuildContext context) {
|
||||||
Widget build(BuildContext context) {
|
// Set status bar color and brightness
|
||||||
// Set status bar color
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
const SystemUiOverlayStyle(
|
||||||
const SystemUiOverlayStyle(
|
statusBarColor: Colors.transparent,
|
||||||
statusBarColor: Colors.transparent,
|
statusBarIconBrightness: Brightness.dark,
|
||||||
statusBarIconBrightness: Brightness.dark,
|
),
|
||||||
),
|
);
|
||||||
);
|
|
||||||
|
|
||||||
if (_showSplash) {
|
return MultiBlocProvider(
|
||||||
return MaterialApp(
|
providers: [
|
||||||
debugShowCheckedModeBanner: false,
|
BlocProvider<AuthCubit>(create: (_) => getIt<AuthCubit>()),
|
||||||
locale: _locale,
|
BlocProvider<ThemeCubit>(create: (_) => getIt<ThemeCubit>()),
|
||||||
supportedLocales: const [
|
],
|
||||||
Locale('en'),
|
child: BlocBuilder<ThemeCubit, ThemeState>(
|
||||||
Locale('hi'),
|
builder: (context, themeState) {
|
||||||
],
|
print('global theme state changed');
|
||||||
localizationsDelegates: const [
|
print(themeState);
|
||||||
AppLocalizations.delegate,
|
return MaterialApp(
|
||||||
GlobalMaterialLocalizations.delegate,
|
debugShowCheckedModeBanner: false,
|
||||||
GlobalWidgetsLocalizations.delegate,
|
locale: _locale ?? const Locale('en'),
|
||||||
GlobalCupertinoLocalizations.delegate,
|
supportedLocales: const [
|
||||||
],
|
Locale('en'),
|
||||||
home: const SplashScreen(),
|
Locale('hi'),
|
||||||
);
|
],
|
||||||
}
|
localizationsDelegates: const [
|
||||||
|
AppLocalizations.delegate,
|
||||||
|
GlobalMaterialLocalizations.delegate,
|
||||||
|
GlobalWidgetsLocalizations.delegate,
|
||||||
return MultiBlocProvider(
|
GlobalCupertinoLocalizations.delegate,
|
||||||
providers: [
|
],
|
||||||
BlocProvider<AuthCubit>(create: (_) => getIt<AuthCubit>()),
|
title: 'kMobile',
|
||||||
],
|
//theme: AppThemes.getLightTheme(themeState.themeType),
|
||||||
child: MaterialApp(
|
theme: themeState.getThemeData(),
|
||||||
title: 'kMobile',
|
// darkTheme: AppThemes.getDarkTheme(themeState.themeType),
|
||||||
// debugShowCheckedModeBanner: false,
|
themeMode: ThemeMode.system,
|
||||||
theme: AppThemes.lightTheme,
|
onGenerateRoute: AppRoutes.generateRoute,
|
||||||
// darkTheme: AppThemes.darkTheme,
|
initialRoute: AppRoutes.splash,
|
||||||
themeMode: ThemeMode.system, // Use system theme by default
|
home: showSplash ? const SplashScreen() : const AuthGate(),
|
||||||
onGenerateRoute: AppRoutes.generateRoute,
|
);
|
||||||
initialRoute: AppRoutes.splash,
|
},
|
||||||
home: const AuthGate(),
|
),
|
||||||
),
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
// Set status bar color
|
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
|
||||||
const SystemUiOverlayStyle(
|
|
||||||
statusBarColor: Colors.transparent,
|
|
||||||
statusBarIconBrightness: Brightness.dark,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return MultiBlocProvider(
|
|
||||||
providers: [BlocProvider<AuthCubit>(create: (_) => getIt<AuthCubit>())],
|
|
||||||
child: MaterialApp(
|
|
||||||
debugShowCheckedModeBanner: false,
|
|
||||||
locale: _locale, // Use your existing locale variable
|
|
||||||
supportedLocales: const [Locale('en'), Locale('hi')],
|
|
||||||
localizationsDelegates: const [
|
|
||||||
AppLocalizations.delegate,
|
|
||||||
GlobalMaterialLocalizations.delegate,
|
|
||||||
GlobalWidgetsLocalizations.delegate,
|
|
||||||
GlobalCupertinoLocalizations.delegate,
|
|
||||||
],
|
|
||||||
title: 'kMobile',
|
|
||||||
theme: AppThemes.lightTheme,
|
|
||||||
// darkTheme: AppThemes.darkTheme,
|
|
||||||
themeMode: ThemeMode.system, // Use system theme by default
|
|
||||||
onGenerateRoute: AppRoutes.generateRoute,
|
|
||||||
initialRoute: AppRoutes.splash,
|
|
||||||
home: _showSplash ? const SplashScreen() : const AuthGate(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
class AuthGate extends StatefulWidget {
|
class AuthGate extends StatefulWidget {
|
||||||
const AuthGate({super.key});
|
const AuthGate({super.key});
|
||||||
|
|
||||||
@@ -193,105 +172,6 @@ class _AuthGateState extends State<AuthGate> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
if (_checking) {
|
|
||||||
return const SplashScreen();
|
|
||||||
}
|
|
||||||
if (_isLoggedIn) {
|
|
||||||
if (_hasMPin) {
|
|
||||||
if (_biometricEnabled) {
|
|
||||||
return FutureBuilder<bool>(
|
|
||||||
future: _tryBiometric(),
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
||||||
return const SplashScreen();
|
|
||||||
}
|
|
||||||
if (snapshot.data == true) {
|
|
||||||
// Authenticated with biometrics, go to dashboard
|
|
||||||
return const NavigationScaffold();
|
|
||||||
}
|
|
||||||
// If not authenticated or user dismissed, show mPIN screen
|
|
||||||
return MPinScreen(
|
|
||||||
mode: MPinMode.enter,
|
|
||||||
onCompleted: (_) {
|
|
||||||
Navigator.of(context).pushReplacement(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (_) => const NavigationScaffold()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return MPinScreen(
|
|
||||||
mode: MPinMode.enter,
|
|
||||||
onCompleted: (_) {
|
|
||||||
Navigator.of(context).pushReplacement(
|
|
||||||
MaterialPageRoute(builder: (_) => const NavigationScaffold()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return MPinScreen(
|
|
||||||
mode: MPinMode.set,
|
|
||||||
onCompleted: (_) async {
|
|
||||||
final storage = getIt<SecureStorage>();
|
|
||||||
final localAuth = LocalAuthentication();
|
|
||||||
|
|
||||||
// 1) Prompt user to opt‐in for biometric
|
|
||||||
final optIn = await showDialog<bool>(
|
|
||||||
context: context,
|
|
||||||
barrierDismissible: false, // force choice
|
|
||||||
builder: (ctx) => AlertDialog(
|
|
||||||
title: const Text('Enable Fingerprint Login?'),
|
|
||||||
content: const Text(
|
|
||||||
'Would you like to enable fingerprint authentication for faster login?',
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.of(ctx).pop(false),
|
|
||||||
child: const Text('No'),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.of(ctx).pop(true),
|
|
||||||
child: const Text('Yes'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// 2) If opted in, perform biometric auth
|
|
||||||
if (optIn == true) {
|
|
||||||
final canCheck = await localAuth.canCheckBiometrics;
|
|
||||||
bool didAuth = false;
|
|
||||||
if (canCheck) {
|
|
||||||
didAuth = await localAuth.authenticate(
|
|
||||||
localizedReason: 'Authenticate to enable fingerprint login',
|
|
||||||
options: const AuthenticationOptions(
|
|
||||||
stickyAuth: true,
|
|
||||||
biometricOnly: true,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await storage.write(
|
|
||||||
'biometric_enabled', didAuth ? 'true' : 'false');
|
|
||||||
} else {
|
|
||||||
await storage.write('biometric_enabled', 'false');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3) Finally go to your main scaffold
|
|
||||||
Navigator.of(context).pushReplacement(
|
|
||||||
MaterialPageRoute(builder: (_) => const NavigationScaffold()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return const LoginScreen();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -413,124 +293,6 @@ class _AuthGateState extends State<AuthGate> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
if (_checking) {
|
|
||||||
return const SplashScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_isLoggedIn) {
|
|
||||||
if (_hasMPin) {
|
|
||||||
if (_biometricEnabled) {
|
|
||||||
return FutureBuilder<bool>(
|
|
||||||
future: _tryBiometric(),
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
||||||
return const SplashScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (snapshot.data == true) {
|
|
||||||
return const NavigationScaffold(); // Authenticated
|
|
||||||
}
|
|
||||||
|
|
||||||
// Failed or dismissed biometric → Show MPIN
|
|
||||||
return MPinScreen(
|
|
||||||
mode: MPinMode.enter,
|
|
||||||
onCompleted: (_) {
|
|
||||||
Navigator.of(context).pushReplacement(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (_) => const NavigationScaffold(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return MPinScreen(
|
|
||||||
mode: MPinMode.enter,
|
|
||||||
onCompleted: (_) {
|
|
||||||
Navigator.of(context).pushReplacement(
|
|
||||||
MaterialPageRoute(builder: (_) => const NavigationScaffold()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return MPinScreen(
|
|
||||||
mode: MPinMode.set,
|
|
||||||
onCompleted: (_) async {
|
|
||||||
final storage = getIt<SecureStorage>();
|
|
||||||
final localAuth = LocalAuthentication();
|
|
||||||
final optin = await showDialog<bool>(
|
|
||||||
context: context,
|
|
||||||
barrierDismissible: false,
|
|
||||||
builder: (ctx) => AlertDialog(
|
|
||||||
title: Text(
|
|
||||||
AppLocalizations.of(context).enableFingerprintLogin,
|
|
||||||
),
|
|
||||||
content: Text(
|
|
||||||
AppLocalizations.of(context).enableFingerprintMessage,
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.of(ctx).pop(false),
|
|
||||||
child: Text(AppLocalizations.of(context).no),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.of(ctx).pop(true),
|
|
||||||
child: Text(AppLocalizations.of(context).yes),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (optin == true) {
|
|
||||||
final canCheck = await localAuth.canCheckBiometrics;
|
|
||||||
bool didAuth = false;
|
|
||||||
|
|
||||||
if (canCheck) {
|
|
||||||
didAuth = await localAuth.authenticate(
|
|
||||||
localizedReason: AppLocalizations.of(
|
|
||||||
context,
|
|
||||||
).authenticateToEnable,
|
|
||||||
options: const AuthenticationOptions(
|
|
||||||
stickyAuth: true,
|
|
||||||
biometricOnly: true,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
await storage.write(
|
|
||||||
'biometric_enabled',
|
|
||||||
didAuth ? 'true' : 'false',
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await storage.write('biometric_enabled', 'false');
|
|
||||||
}
|
|
||||||
|
|
||||||
Navigator.of(context).pushReplacement(
|
|
||||||
MaterialPageRoute(builder: (_) => const NavigationScaffold()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 🔻 Show Welcome screen before login if not logged in
|
|
||||||
if (_showWelcome) {
|
|
||||||
return WelcomeScreen(
|
|
||||||
onContinue: () {
|
|
||||||
setState(() {
|
|
||||||
_showWelcome = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return const LoginScreen();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
class NavigationScaffold extends StatefulWidget {
|
class NavigationScaffold extends StatefulWidget {
|
||||||
const NavigationScaffold({super.key});
|
const NavigationScaffold({super.key});
|
||||||
|
|
||||||
@@ -595,8 +357,8 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
|
|||||||
bottomNavigationBar: BottomNavigationBar(
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
currentIndex: _selectedIndex,
|
currentIndex: _selectedIndex,
|
||||||
type: BottomNavigationBarType.fixed,
|
type: BottomNavigationBarType.fixed,
|
||||||
backgroundColor: const Color(0xFFE0F7FA), // Light blue background
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor, // Light blue background
|
||||||
selectedItemColor: Colors.blue[800],
|
selectedItemColor: Theme.of(context).primaryColor,
|
||||||
unselectedItemColor: Colors.black54,
|
unselectedItemColor: Colors.black54,
|
||||||
onTap: _onItemTapped,
|
onTap: _onItemTapped,
|
||||||
items: [
|
items: [
|
||||||
|
6
lib/config/theme_type.dart
Normal file
6
lib/config/theme_type.dart
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
enum ThemeType {
|
||||||
|
violet,
|
||||||
|
green,
|
||||||
|
orange,
|
||||||
|
blue,
|
||||||
|
}
|
@@ -1,266 +1,32 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'theme_type.dart';
|
||||||
|
|
||||||
class AppThemes {
|
class AppThemes {
|
||||||
// Private constructor to prevent instantiation
|
static ThemeData getLightTheme(ThemeType type) {
|
||||||
AppThemes._();
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Light theme colors
|
static ThemeData getDarkTheme(ThemeType type) {
|
||||||
static const Color _primaryColorLight = Color(0xFF1E88E5); // Blue 600
|
switch (type) {
|
||||||
static const Color _secondaryColorLight = Color(0xFF26A69A); // Teal 400
|
case ThemeType.green:
|
||||||
static const Color _errorColorLight = Color(0xFFE53935); // Red 600
|
return ThemeData.dark().copyWith(primaryColor: Colors.green);
|
||||||
static const Color _surfaceColorLight = Colors.white;
|
case ThemeType.orange:
|
||||||
|
return ThemeData.dark().copyWith(primaryColor: Colors.orange);
|
||||||
// Dark theme colors
|
case ThemeType.blue:
|
||||||
static const Color _primaryColorDark = Color(0xFF42A5F5); // Blue 400
|
return ThemeData.dark().copyWith(primaryColor: Colors.blue);
|
||||||
static const Color _secondaryColorDark = Color(0xFF4DB6AC); // Teal 300
|
case ThemeType.violet:
|
||||||
static const Color _errorColorDark = Color(0xFFEF5350); // Red 400
|
default:
|
||||||
static const Color _surfaceColorDark = Color(0xFF1E1E1E);
|
return ThemeData.dark().copyWith(primaryColor: Colors.deepPurple);
|
||||||
|
}
|
||||||
// Text themes
|
}
|
||||||
static const TextTheme _textThemeLight = TextTheme(
|
|
||||||
displayLarge: TextStyle(
|
|
||||||
fontSize: 96,
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
displayMedium: TextStyle(
|
|
||||||
fontSize: 60,
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
displaySmall: TextStyle(
|
|
||||||
fontSize: 48,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
headlineMedium: TextStyle(
|
|
||||||
fontSize: 34,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
headlineSmall: TextStyle(
|
|
||||||
fontSize: 24,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
titleLarge: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
bodyLarge: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
bodyMedium: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
bodySmall: TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Color(0xFF757575),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
labelLarge: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Color(0xFF212121),
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
static final TextTheme _textThemeDark = _textThemeLight.copyWith(
|
|
||||||
displayLarge: _textThemeLight.displayLarge?.copyWith(color: Colors.white),
|
|
||||||
displayMedium: _textThemeLight.displayMedium?.copyWith(color: Colors.white),
|
|
||||||
displaySmall: _textThemeLight.displaySmall?.copyWith(color: Colors.white),
|
|
||||||
headlineMedium:
|
|
||||||
_textThemeLight.headlineMedium?.copyWith(color: Colors.white),
|
|
||||||
headlineSmall: _textThemeLight.headlineSmall?.copyWith(color: Colors.white),
|
|
||||||
titleLarge: _textThemeLight.titleLarge?.copyWith(color: Colors.white),
|
|
||||||
bodyLarge: _textThemeLight.bodyLarge?.copyWith(color: Colors.white),
|
|
||||||
bodyMedium: _textThemeLight.bodyMedium?.copyWith(color: Colors.white),
|
|
||||||
bodySmall: _textThemeLight.bodySmall?.copyWith(color: Colors.white70),
|
|
||||||
labelLarge: _textThemeLight.labelLarge?.copyWith(color: Colors.white),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Light theme
|
|
||||||
static final ThemeData lightTheme = ThemeData(
|
|
||||||
useMaterial3: true,
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
colorScheme: const ColorScheme.light(
|
|
||||||
primary: _primaryColorLight,
|
|
||||||
secondary: _secondaryColorLight,
|
|
||||||
error: _errorColorLight,
|
|
||||||
surface: _surfaceColorLight,
|
|
||||||
onPrimary: Colors.white,
|
|
||||||
onSecondary: Colors.white,
|
|
||||||
onSurface: Colors.black87,
|
|
||||||
onError: Colors.white,
|
|
||||||
brightness: Brightness.light,
|
|
||||||
),
|
|
||||||
textTheme: _textThemeLight,
|
|
||||||
appBarTheme: const AppBarTheme(
|
|
||||||
elevation: 0,
|
|
||||||
backgroundColor: _surfaceColorLight,
|
|
||||||
foregroundColor: Color(0xFF212121),
|
|
||||||
centerTitle: true,
|
|
||||||
),
|
|
||||||
cardTheme: CardThemeData(
|
|
||||||
//Earlier CardThemeData
|
|
||||||
elevation: 2,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
foregroundColor: Colors.white,
|
|
||||||
backgroundColor: _primaryColorLight,
|
|
||||||
elevation: 2,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
||||||
style: OutlinedButton.styleFrom(
|
|
||||||
foregroundColor: _primaryColorLight,
|
|
||||||
side: const BorderSide(color: _primaryColorLight),
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
textButtonTheme: TextButtonThemeData(
|
|
||||||
style: TextButton.styleFrom(
|
|
||||||
foregroundColor: _primaryColorLight,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
inputDecorationTheme: InputDecorationTheme(
|
|
||||||
filled: true,
|
|
||||||
fillColor: Colors.grey[100],
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: BorderSide.none,
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: BorderSide(color: Colors.grey[300]!),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: _primaryColorLight, width: 2),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: _errorColorLight, width: 2),
|
|
||||||
),
|
|
||||||
labelStyle: const TextStyle(color: Colors.grey),
|
|
||||||
),
|
|
||||||
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
|
|
||||||
selectedItemColor: _primaryColorLight,
|
|
||||||
unselectedItemColor: Colors.grey,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Dark theme
|
|
||||||
static final ThemeData darkTheme = ThemeData(
|
|
||||||
fontFamily: 'Rubik',
|
|
||||||
useMaterial3: true,
|
|
||||||
colorScheme: const ColorScheme.dark(
|
|
||||||
primary: _primaryColorDark,
|
|
||||||
secondary: _secondaryColorDark,
|
|
||||||
error: _errorColorDark,
|
|
||||||
surface: _surfaceColorDark,
|
|
||||||
onPrimary: Colors.black,
|
|
||||||
onSecondary: Colors.black,
|
|
||||||
onSurface: Colors.white,
|
|
||||||
onError: Colors.black,
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
),
|
|
||||||
textTheme: _textThemeDark,
|
|
||||||
appBarTheme: const AppBarTheme(
|
|
||||||
elevation: 0,
|
|
||||||
backgroundColor: _surfaceColorDark,
|
|
||||||
foregroundColor: Colors.white,
|
|
||||||
centerTitle: true,
|
|
||||||
),
|
|
||||||
cardTheme: CardThemeData(
|
|
||||||
//Earlier was CardThemeData
|
|
||||||
elevation: 2,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
color: const Color(0xFF2C2C2C),
|
|
||||||
),
|
|
||||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
foregroundColor: Colors.black,
|
|
||||||
backgroundColor: _primaryColorDark,
|
|
||||||
elevation: 2,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
||||||
style: OutlinedButton.styleFrom(
|
|
||||||
foregroundColor: _primaryColorDark,
|
|
||||||
side: const BorderSide(color: _primaryColorDark),
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
textButtonTheme: TextButtonThemeData(
|
|
||||||
style: TextButton.styleFrom(
|
|
||||||
foregroundColor: _primaryColorDark,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
inputDecorationTheme: InputDecorationTheme(
|
|
||||||
filled: true,
|
|
||||||
fillColor: const Color(0xFF2A2A2A),
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: BorderSide.none,
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: Color(0xFF3A3A3A)),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: _primaryColorDark, width: 2),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: _errorColorDark, width: 2),
|
|
||||||
),
|
|
||||||
labelStyle: const TextStyle(color: Colors.grey),
|
|
||||||
),
|
|
||||||
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
|
|
||||||
selectedItemColor: _primaryColorDark,
|
|
||||||
unselectedItemColor: Colors.grey,
|
|
||||||
backgroundColor: _surfaceColorDark,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
52
lib/data/models/beneficiary.dart
Normal file
52
lib/data/models/beneficiary.dart
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
|
||||||
|
// ignore_for_file: non_constant_identifier_names
|
||||||
|
|
||||||
|
class Beneficiary {
|
||||||
|
final String accountNo;
|
||||||
|
final String accountType;
|
||||||
|
final String name;
|
||||||
|
final String ifscCode;
|
||||||
|
final String? bankName;
|
||||||
|
final String? branchName;
|
||||||
|
|
||||||
|
Beneficiary({
|
||||||
|
required this.accountNo,
|
||||||
|
required this.accountType,
|
||||||
|
required this.name,
|
||||||
|
required this.ifscCode,
|
||||||
|
this.bankName,
|
||||||
|
this.branchName,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Beneficiary.fromJson(Map<String, dynamic> json) {
|
||||||
|
return Beneficiary(
|
||||||
|
accountNo: json['accountNo'] ?? '',
|
||||||
|
accountType: json['accountType'] ?? '',
|
||||||
|
name: json['name'] ?? '',
|
||||||
|
ifscCode: json['ifscCode'] ?? '',
|
||||||
|
bankName: json['bankName'] ?? '',
|
||||||
|
branchName: json['branchName'] ?? '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return {
|
||||||
|
'accountNo': accountNo,
|
||||||
|
'accountType': accountType,
|
||||||
|
'name': name,
|
||||||
|
'ifscCode' : ifscCode,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<Beneficiary> listFromJson(List<dynamic> jsonList) {
|
||||||
|
final beneficiaryList = jsonList.map((beneficiary) => Beneficiary.fromJson(beneficiary)).toList();
|
||||||
|
print(beneficiaryList);
|
||||||
|
return beneficiaryList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'Beneficiary(accountNo: $accountNo, accountType: $accountType, ifscCode: $ifscCode, name: $name)';
|
||||||
|
}
|
||||||
|
}
|
45
lib/data/models/beneficiary_recieve.dart
Normal file
45
lib/data/models/beneficiary_recieve.dart
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
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)';
|
||||||
|
}
|
||||||
|
}
|
32
lib/data/models/ifsc.dart
Normal file
32
lib/data/models/ifsc.dart
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
class ifsc {
|
||||||
|
final String ifscCode;
|
||||||
|
final String bankName;
|
||||||
|
final String branchName;
|
||||||
|
|
||||||
|
ifsc({
|
||||||
|
required this.ifscCode,
|
||||||
|
required this.bankName,
|
||||||
|
required this.branchName,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory ifsc.fromJson(Map<String, dynamic> json) {
|
||||||
|
return ifsc(
|
||||||
|
ifscCode: json['ifsc_code'] ?? '',
|
||||||
|
bankName: json['bank_name'] ?? '',
|
||||||
|
branchName: json['branch_name'] ?? '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return {
|
||||||
|
'ifsc_code': ifscCode,
|
||||||
|
'bank_name': bankName,
|
||||||
|
'branch_name': branchName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'IFSC(ifscCode: $ifscCode, bankName: $bankName, branchName: $branchName)';
|
||||||
|
}
|
||||||
|
}
|
@@ -4,15 +4,22 @@ import 'package:kmobile/api/services/beneficiary_service.dart';
|
|||||||
import 'package:kmobile/api/services/payment_service.dart';
|
import 'package:kmobile/api/services/payment_service.dart';
|
||||||
import 'package:kmobile/api/services/user_service.dart';
|
import 'package:kmobile/api/services/user_service.dart';
|
||||||
import 'package:kmobile/data/repositories/transaction_repository.dart';
|
import 'package:kmobile/data/repositories/transaction_repository.dart';
|
||||||
|
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
||||||
import '../api/services/auth_service.dart';
|
import '../api/services/auth_service.dart';
|
||||||
import '../api/interceptors/auth_interceptor.dart';
|
import '../api/interceptors/auth_interceptor.dart';
|
||||||
import '../data/repositories/auth_repository.dart';
|
import '../data/repositories/auth_repository.dart';
|
||||||
import '../features/auth/controllers/auth_cubit.dart';
|
import '../features/auth/controllers/auth_cubit.dart';
|
||||||
import '../security/secure_storage.dart';
|
import '../security/secure_storage.dart';
|
||||||
|
|
||||||
|
|
||||||
final getIt = GetIt.instance;
|
final getIt = GetIt.instance;
|
||||||
|
|
||||||
Future<void> setupDependencies() async {
|
Future<void> setupDependencies() async {
|
||||||
|
|
||||||
|
//getIt.registerLazySingleton<ThemeController>(() => ThemeController());
|
||||||
|
//getIt.registerLazySingleton<ThemeModeController>(() => ThemeModeController());
|
||||||
|
getIt.registerSingleton<ThemeCubit>( ThemeCubit());
|
||||||
|
|
||||||
// Register Dio client
|
// Register Dio client
|
||||||
getIt.registerSingleton<Dio>(_createDioClient());
|
getIt.registerSingleton<Dio>(_createDioClient());
|
||||||
|
|
||||||
@@ -44,13 +51,15 @@ Future<void> setupDependencies() async {
|
|||||||
// Register controllers/cubits
|
// Register controllers/cubits
|
||||||
getIt.registerFactory<AuthCubit>(
|
getIt.registerFactory<AuthCubit>(
|
||||||
() => AuthCubit(getIt<AuthRepository>(), getIt<UserService>()));
|
() => AuthCubit(getIt<AuthRepository>(), getIt<UserService>()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dio _createDioClient() {
|
Dio _createDioClient() {
|
||||||
final dio = Dio(
|
final dio = Dio(
|
||||||
BaseOptions(
|
BaseOptions(
|
||||||
baseUrl:
|
baseUrl:
|
||||||
'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080',
|
//'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080',
|
||||||
|
'http://localhost:8081',
|
||||||
connectTimeout: const Duration(seconds: 5),
|
connectTimeout: const Duration(seconds: 5),
|
||||||
receiveTimeout: const Duration(seconds: 3),
|
receiveTimeout: const Duration(seconds: 3),
|
||||||
headers: {
|
headers: {
|
||||||
|
@@ -191,7 +191,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
@@ -206,7 +206,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
textInputAction: TextInputAction.done,
|
textInputAction: TextInputAction.done,
|
||||||
@@ -220,9 +220,9 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Theme.of(context).primaryColor,
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
),
|
),
|
||||||
child: const Icon(
|
child: Icon(
|
||||||
Symbols.arrow_forward,
|
Symbols.arrow_forward,
|
||||||
color: Colors.white,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
size: 30,
|
size: 30,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -250,9 +250,9 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
leading: Shimmer.fromColors(
|
leading: Shimmer.fromColors(
|
||||||
baseColor: Colors.grey[300]!,
|
baseColor: Colors.grey[300]!,
|
||||||
highlightColor: Colors.grey[100]!,
|
highlightColor: Colors.grey[100]!,
|
||||||
child: const CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 12,
|
radius: 12,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
title: Shimmer.fromColors(
|
title: Shimmer.fromColors(
|
||||||
@@ -261,7 +261,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
height: 10,
|
height: 10,
|
||||||
width: 100,
|
width: 100,
|
||||||
color: Colors.white,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Shimmer.fromColors(
|
subtitle: Shimmer.fromColors(
|
||||||
@@ -270,7 +270,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
height: 8,
|
height: 8,
|
||||||
width: 60,
|
width: 60,
|
||||||
color: Colors.white,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
48
lib/features/auth/controllers/theme_cubit.dart
Normal file
48
lib/features/auth/controllers/theme_cubit.dart
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
class ThemeCubit extends Cubit<ThemeState> {
|
||||||
|
ThemeCubit(): super(ThemeViolet()) {
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> changeTheme(ThemeType type) async {
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
27
lib/features/auth/controllers/theme_state.dart
Normal file
27
lib/features/auth/controllers/theme_state.dart
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:kmobile/config/theme_type.dart';
|
||||||
|
import 'package:kmobile/config/themes.dart';
|
||||||
|
|
||||||
|
|
||||||
|
abstract class ThemeState extends Equatable {
|
||||||
|
getThemeData();
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class ThemeBlue extends ThemeState {
|
||||||
|
|
||||||
|
@override
|
||||||
|
getThemeData() {
|
||||||
|
print('returning blue theme');
|
||||||
|
return AppThemes.getLightTheme(ThemeType.blue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ThemeViolet extends ThemeState {
|
||||||
|
@override
|
||||||
|
getThemeData() {
|
||||||
|
print('returning violet theme');
|
||||||
|
return AppThemes.getLightTheme(ThemeType.violet);
|
||||||
|
}
|
||||||
|
}
|
@@ -108,10 +108,10 @@ class LoginScreenState extends State<LoginScreen>
|
|||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 150,
|
||||||
errorBuilder: (context, error, stackTrace) {
|
errorBuilder: (context, error, stackTrace) {
|
||||||
return const Icon(
|
return Icon(
|
||||||
Icons.account_balance,
|
Icons.account_balance,
|
||||||
size: 100,
|
size: 100,
|
||||||
color: Colors.blue,
|
color: Theme.of(context).primaryColor,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -123,7 +123,7 @@ class LoginScreenState extends State<LoginScreen>
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Colors.blue,
|
color: Theme.of(context).primaryColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 48),
|
const SizedBox(height: 48),
|
||||||
@@ -136,7 +136,7 @@ class LoginScreenState extends State<LoginScreen>
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -166,7 +166,7 @@ class LoginScreenState extends State<LoginScreen>
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: const OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -202,8 +202,8 @@ class LoginScreenState extends State<LoginScreen>
|
|||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
foregroundColor: Colors.blueAccent,
|
foregroundColor: Theme.of(context).primaryColorDark,
|
||||||
side: const BorderSide(color: Colors.black, width: 1),
|
side: const BorderSide(color: Colors.black, width: 1),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
),
|
||||||
@@ -242,7 +242,7 @@ class LoginScreenState extends State<LoginScreen>
|
|||||||
style: OutlinedButton.styleFrom(
|
style: OutlinedButton.styleFrom(
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
backgroundColor: Colors.lightBlue[100],
|
backgroundColor: Theme.of(context).primaryColorLight,
|
||||||
foregroundColor: Colors.black,
|
foregroundColor: Colors.black,
|
||||||
),
|
),
|
||||||
child: Text(AppLocalizations.of(context).register),
|
child: Text(AppLocalizations.of(context).register),
|
||||||
|
@@ -197,7 +197,7 @@ class _MPinScreenState extends State<MPinScreen> {
|
|||||||
key == '<' ? '⌫' : key,
|
key == '<' ? '⌫' : key,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: key == 'Enter' ? Colors.blue : Colors.black,
|
color: key == 'Enter' ? Theme.of(context).primaryColor : Colors.black,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@@ -17,10 +17,13 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
// Automatically go to login after 6 seconds
|
// Automatically go to logizn after 4 seconds
|
||||||
Timer(const Duration(seconds: 6), () {
|
Timer(const Duration(seconds: 4), () {
|
||||||
|
|
||||||
widget.onContinue();
|
widget.onContinue();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -43,10 +46,10 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context).kconnect,
|
AppLocalizations.of(context).kconnect,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 36,
|
fontSize: 36,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
letterSpacing: 1.5,
|
letterSpacing: 1.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -54,9 +57,9 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
|
|||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context).kccBankFull,
|
AppLocalizations.of(context).kccBankFull,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
letterSpacing: 1.2,
|
letterSpacing: 1.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -65,12 +68,12 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
/// 🔹 Loading Spinner at Bottom
|
/// 🔹 Loading Spinner at Bottom
|
||||||
const Positioned(
|
Positioned(
|
||||||
bottom: 40,
|
bottom: 40,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: CircularProgressIndicator(color: Colors.white),
|
child: CircularProgressIndicator(color: Theme.of(context).scaffoldBackgroundColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -1,10 +1,23 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
|
import 'package:kmobile/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 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
import '../../../di/injection.dart';
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
class AddBeneficiaryScreen extends StatefulWidget {
|
class AddBeneficiaryScreen extends StatefulWidget {
|
||||||
const AddBeneficiaryScreen({super.key});
|
final List<User>? users;
|
||||||
|
final int? selectedIndex;
|
||||||
|
|
||||||
|
const AddBeneficiaryScreen({
|
||||||
|
super.key,
|
||||||
|
this.users,
|
||||||
|
this.selectedIndex,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AddBeneficiaryScreen> createState() => _AddBeneficiaryScreen();
|
State<AddBeneficiaryScreen> createState() => _AddBeneficiaryScreen();
|
||||||
@@ -13,6 +26,7 @@ class AddBeneficiaryScreen extends StatefulWidget {
|
|||||||
class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||||
final _formKey = GlobalKey<FormState>();
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
|
late User selectedUser = (widget.users ?? [])[widget.selectedIndex!];
|
||||||
final TextEditingController accountNumberController = TextEditingController();
|
final TextEditingController accountNumberController = TextEditingController();
|
||||||
final TextEditingController confirmAccountNumberController =
|
final TextEditingController confirmAccountNumberController =
|
||||||
TextEditingController();
|
TextEditingController();
|
||||||
@@ -22,6 +36,11 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
final TextEditingController ifscController = TextEditingController();
|
final TextEditingController ifscController = TextEditingController();
|
||||||
final TextEditingController phoneController = TextEditingController();
|
final TextEditingController phoneController = TextEditingController();
|
||||||
|
|
||||||
|
String? _beneficiaryName;
|
||||||
|
bool _isValidating = false;
|
||||||
|
bool _isBeneficiaryValidated = false;
|
||||||
|
String? _validationError;
|
||||||
|
|
||||||
late String accountType;
|
late String accountType;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -34,94 +53,167 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _submitForm() {
|
|
||||||
if (_formKey.currentState!.validate()) {
|
|
||||||
// Handle successful submission
|
ifsc? _ifscData;
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
bool _isLoading = false; //for validateIFSC()
|
||||||
SnackBar(
|
|
||||||
backgroundColor: Colors.grey[900],
|
void _validateIFSC() async {
|
||||||
behavior: SnackBarBehavior.floating,
|
var beneficiaryService = getIt<BeneficiaryService>();
|
||||||
margin: const EdgeInsets.all(12),
|
final ifsc = ifscController.text.trim().toUpperCase();
|
||||||
duration: const Duration(seconds: 5),
|
if (ifsc.isEmpty) return;
|
||||||
content: Row(
|
setState(() {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
_isLoading = true;
|
||||||
children: [
|
_ifscData = null;
|
||||||
Expanded(
|
});
|
||||||
child: Text(
|
|
||||||
AppLocalizations.of(context).beneficiaryAdded,
|
final result = await beneficiaryService.validateIFSC(ifsc);
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
setState(() {
|
||||||
),
|
_isLoading = false;
|
||||||
TextButton(
|
_ifscData = result;
|
||||||
onPressed: () {
|
});
|
||||||
// Navigate to Payment Screen or do something
|
|
||||||
},
|
if (result == null) {
|
||||||
style: TextButton.styleFrom(foregroundColor: Colors.blue[200]),
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
child: Text(AppLocalizations.of(context).payNow),
|
SnackBar(content: Text(AppLocalizations.of(context).invalidIfsc)),
|
||||||
),
|
);
|
||||||
IconButton(
|
bankNameController.clear();
|
||||||
icon: const Icon(Icons.close, color: Colors.white),
|
branchNameController.clear();
|
||||||
onPressed: () {
|
} else {
|
||||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
await Future.delayed(const Duration(seconds: intervalSeconds));
|
||||||
|
elapsed += intervalSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (foundName != null) {
|
||||||
|
setState(() {
|
||||||
|
nameController.text = foundName!;
|
||||||
|
_isBeneficiaryValidated = true;
|
||||||
|
_validationError = null;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
_validationError = 'Beneficiary not found within timeout.';
|
||||||
|
_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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Navigator.pop(context); // Close the spinner
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(content: Text(AppLocalizations.of(context).somethingWentWrong)),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void _validateIFSC() async {
|
|
||||||
final ifsc = ifscController.text.trim().toUpperCase();
|
|
||||||
|
|
||||||
// 🔹 Format check
|
|
||||||
final isValidFormat = RegExp(r'^[A-Z]{4}0[A-Z0-9]{6}$').hasMatch(ifsc);
|
|
||||||
if (!isValidFormat) {
|
|
||||||
bankNameController.clear();
|
|
||||||
branchNameController.clear();
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(content: Text(AppLocalizations.of(context).invalidIfscFormat)),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await Future.delayed(
|
|
||||||
const Duration(seconds: 2),
|
|
||||||
); //Mock delay for 2 sec to imitate api call
|
|
||||||
// 🔹 Mock IFSC lookup (you can replace this with API)
|
|
||||||
const mockIfscData = {
|
|
||||||
'KCCB0001234': {
|
|
||||||
'bank': 'Kangra Central Co-operative Bank',
|
|
||||||
'branch': 'Dharamshala',
|
|
||||||
},
|
|
||||||
'SBIN0004567': {
|
|
||||||
'bank': 'State Bank of India',
|
|
||||||
'branch': 'Connaught Place',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
if (mockIfscData.containsKey(ifsc)) {
|
|
||||||
final data = mockIfscData[ifsc]!;
|
|
||||||
bankNameController.text = data['bank']!;
|
|
||||||
branchNameController.text = data['branch']!;
|
|
||||||
} else {
|
|
||||||
bankNameController.clear();
|
|
||||||
branchNameController.clear();
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(content: Text(AppLocalizations.of(context).noIfscDetails)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
🔸 Optional: Use real IFSC API like:
|
|
||||||
final response = await http.get(Uri.parse('https://ifsc.razorpay.com/$ifsc'));
|
|
||||||
if (response.statusCode == 200) {
|
|
||||||
final data = jsonDecode(response.body);
|
|
||||||
bankNameController.text = data['BANK'];
|
|
||||||
branchNameController.text = data['BRANCH'];
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -176,11 +268,11 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -211,11 +303,11 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -239,148 +331,19 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
TextFormField(
|
|
||||||
controller: nameController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: AppLocalizations.of(context).name,
|
|
||||||
// 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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
validator: (value) => value == null || value.isEmpty
|
|
||||||
? AppLocalizations.of(context).nameRequired
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
/*const SizedBox(height: 24),
|
|
||||||
TextFormField(
|
|
||||||
controller: bankNameController,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'Beneficiary Bank Name',
|
|
||||||
// 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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
validator: (value) =>
|
|
||||||
value == null || value.isEmpty ? "Bank name is required" : null,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
TextFormField(
|
|
||||||
controller: branchNameController,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'Branch Name',
|
|
||||||
// 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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
validator: (value) =>
|
|
||||||
value == null || value.isEmpty ? "Branch name is required" : null,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: TextFormField(
|
|
||||||
controller: ifscController,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'IFSC Code',
|
|
||||||
// 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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
validator: (value) => value == null || value.length < 5
|
|
||||||
? "Enter a valid IFSC"
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 16),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: DropdownButtonFormField<String>(
|
|
||||||
value: accountType,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'Account Type',
|
|
||||||
// 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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
items: ['Savings', 'Current']
|
|
||||||
.map((type) => DropdownMenuItem(
|
|
||||||
value: type,
|
|
||||||
child: Text(type),
|
|
||||||
))
|
|
||||||
.toList(),
|
|
||||||
onChanged: (value) {
|
|
||||||
setState(() {
|
|
||||||
accountType = value!;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),*/
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
// 🔹 IFSC Code Field
|
// 🔹 IFSC Code Field
|
||||||
TextFormField(
|
TextFormField(
|
||||||
controller: ifscController,
|
controller: ifscController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context).ifscCode,
|
labelText: AppLocalizations.of(context).ifscCode,
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -422,14 +385,14 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
enabled: false, // changed from readOnly to disabled
|
enabled: false, // changed from readOnly to disabled
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context).bankName,
|
labelText: AppLocalizations.of(context).bankName,
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white, // disabled color
|
fillColor: Theme.of(context).dialogBackgroundColor, // disabled color
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -445,14 +408,14 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
enabled: false, // changed from readOnly to disabled
|
enabled: false, // changed from readOnly to disabled
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context).branchName,
|
labelText: AppLocalizations.of(context).branchName,
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).dialogBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -460,21 +423,73 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
//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'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
//Beneficiary Name (Disabled)
|
||||||
|
TextFormField(
|
||||||
|
controller: nameController,
|
||||||
|
enabled: false,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: AppLocalizations.of(context).beneficiaryName,
|
||||||
|
border: const OutlineInputBorder(),
|
||||||
|
isDense: true,
|
||||||
|
filled: true,
|
||||||
|
fillColor: Theme.of(context).dialogBackgroundColor,
|
||||||
|
enabledBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.black),
|
||||||
|
),
|
||||||
|
focusedBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
validator: (value) => value == null || value.isEmpty
|
||||||
|
? AppLocalizations.of(context).nameRequired
|
||||||
|
: null,
|
||||||
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
// 🔹 Account Type Dropdown
|
// 🔹 Account Type Dropdown
|
||||||
DropdownButtonFormField<String>(
|
DropdownButtonFormField<String>(
|
||||||
value: accountType,
|
value: accountType,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context).accountType,
|
labelText: AppLocalizations.of(context).accountType,
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -506,15 +521,15 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
keyboardType: TextInputType.phone,
|
keyboardType: TextInputType.phone,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context).phone,
|
labelText: AppLocalizations.of(context).phone,
|
||||||
prefixIcon: Icon(Icons.phone),
|
prefixIcon: const Icon(Icons.phone),
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -538,12 +553,13 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 250,
|
width: 250,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: _submitForm,
|
onPressed:
|
||||||
|
validateAndAddBeneficiary,
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
backgroundColor: Colors.blue[900],
|
backgroundColor: Theme.of(context).primaryColorDark,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
child: Text(AppLocalizations.of(context).validateAndAdd),
|
child: Text(AppLocalizations.of(context).validateAndAdd),
|
||||||
),
|
),
|
||||||
|
115
lib/features/beneficiaries/screens/beneficiary_result_page.dart
Normal file
115
lib/features/beneficiaries/screens/beneficiary_result_page.dart
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:lottie/lottie.dart';
|
||||||
|
import 'package:confetti/confetti.dart';
|
||||||
|
import 'dart:math';
|
||||||
|
import '../../../app.dart';
|
||||||
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
class BeneficiaryResultPage extends StatefulWidget {
|
||||||
|
final bool isSuccess;
|
||||||
|
|
||||||
|
const BeneficiaryResultPage({super.key, required this.isSuccess});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<BeneficiaryResultPage> createState() => _BeneficiaryResultPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BeneficiaryResultPageState extends State<BeneficiaryResultPage> {
|
||||||
|
late ConfettiController _confettiController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_confettiController =
|
||||||
|
ConfettiController(duration: const Duration(seconds: 3));
|
||||||
|
if (widget.isSuccess) {
|
||||||
|
_confettiController.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_confettiController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final successAnimation = 'assets/animations/done.json';
|
||||||
|
final errorAnimation = 'assets/animations/error.json';
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: widget.isSuccess ? Colors.green[50] : Colors.red[50],
|
||||||
|
body: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Lottie.asset(
|
||||||
|
widget.isSuccess ? successAnimation : errorAnimation,
|
||||||
|
width: 150,
|
||||||
|
height: 150,
|
||||||
|
repeat: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Text(
|
||||||
|
widget.isSuccess
|
||||||
|
? AppLocalizations.of(context).beneficiaryAddedSuccess
|
||||||
|
: AppLocalizations.of(context).beneficiaryAdditionFailed,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: widget.isSuccess ? Colors.green : Colors.red,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
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
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (widget.isSuccess)
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
|
child: ConfettiWidget(
|
||||||
|
confettiController: _confettiController,
|
||||||
|
blastDirection: pi / 2,
|
||||||
|
maxBlastForce: 10,
|
||||||
|
minBlastForce: 5,
|
||||||
|
emissionFrequency: 0.05,
|
||||||
|
numberOfParticles: 20,
|
||||||
|
gravity: 0.2,
|
||||||
|
shouldLoop: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +1,17 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:kmobile/data/models/beneficiary.dart';
|
||||||
import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import '../../../data/models/user.dart';
|
||||||
import '../../../l10n/app_localizations.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';
|
||||||
|
|
||||||
class ManageBeneficiariesScreen extends StatefulWidget {
|
class ManageBeneficiariesScreen extends StatefulWidget {
|
||||||
|
// final List<User> users;
|
||||||
|
// final int selectedIndex;
|
||||||
|
|
||||||
const ManageBeneficiariesScreen({super.key});
|
const ManageBeneficiariesScreen({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -13,67 +20,87 @@ class ManageBeneficiariesScreen extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
||||||
final List<Map<String, String>> beneficiaries = [
|
var service = getIt<BeneficiaryService>();
|
||||||
{'bank': 'State Bank Of India', 'name': 'Trina Bakshi'},
|
// late User selectedUser = widget.users[widget.selectedIndex];
|
||||||
{'bank': 'State Bank Of India', 'name': 'Sheetal Rao'},
|
//final BeneficiaryService _service = BeneficiaryService();
|
||||||
{'bank': 'Punjab National Bank', 'name': 'Manoj Kumar'},
|
bool _isLoading = true;
|
||||||
{'bank': 'State Bank Of India', 'name': 'Rohit Mehra'},
|
int selectedAccountIndex = 0;
|
||||||
];
|
List<Beneficiary> _beneficiaries = [];
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_loadBeneficiaries();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _loadBeneficiaries() async {
|
||||||
|
final data = await service.fetchBeneficiaryList();
|
||||||
|
setState(() {
|
||||||
|
_beneficiaries = data ;
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildShimmerList() {
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: 6,
|
||||||
|
itemBuilder: (context, index) => Shimmer.fromColors(
|
||||||
|
baseColor: Colors.grey.shade300,
|
||||||
|
highlightColor: Colors.grey.shade100,
|
||||||
|
child: ListTile(
|
||||||
|
leading: const CircleAvatar(
|
||||||
|
radius: 24,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
),
|
||||||
|
title: Container(
|
||||||
|
height: 16,
|
||||||
|
color: Colors.white,
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||||
|
),
|
||||||
|
subtitle: Container(
|
||||||
|
height: 14,
|
||||||
|
color: Colors.white,
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildBeneficiaryList() {
|
||||||
|
if (_beneficiaries.isEmpty) {
|
||||||
|
return Center(child: Text(AppLocalizations.of(context).noBeneficiaryFound));
|
||||||
|
}
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: _beneficiaries.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final item = _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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: Text(item.name ?? 'Unknown'),
|
||||||
|
subtitle: Text(item.accountNo ?? 'No account number'),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: IconButton(
|
title: Text(AppLocalizations.of(context).beneficiaries),
|
||||||
icon: const Icon(Symbols.arrow_back_ios_new),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
AppLocalizations.of(context).beneficiaries,
|
|
||||||
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: const CircleAvatar(
|
|
||||||
backgroundColor: Colors.blue,
|
|
||||||
child: Text('A'),
|
|
||||||
),
|
|
||||||
title: Text(beneficiary['name']!),
|
|
||||||
subtitle: Text(beneficiary['bank']!),
|
|
||||||
trailing: IconButton(
|
|
||||||
icon: const Icon(Symbols.delete_forever, color: Colors.red),
|
|
||||||
onPressed: () {
|
|
||||||
// Delete action
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
body: _isLoading ? _buildShimmerList() : _buildBeneficiaryList(),
|
||||||
floatingActionButton: Padding(
|
floatingActionButton: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 8.0),
|
padding: const EdgeInsets.only(bottom: 8.0),
|
||||||
child: FloatingActionButton(
|
child: FloatingActionButton(
|
||||||
@@ -81,12 +108,12 @@ class _ManageBeneficiariesScreen extends State<ManageBeneficiariesScreen> {
|
|||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => const AddBeneficiaryScreen(),
|
builder: (context) => AddBeneficiaryScreen(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
backgroundColor: Colors.grey[300],
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
foregroundColor: Colors.blue[900],
|
foregroundColor: Theme.of(context).primaryColor,
|
||||||
elevation: 5,
|
elevation: 5,
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
),
|
),
|
||||||
|
@@ -42,7 +42,7 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Just close the SnackBar
|
// Just close the SnackBar
|
||||||
},
|
},
|
||||||
textColor: Colors.white,
|
textColor: Theme.of(context).dialogBackgroundColor,
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
behavior: SnackBarBehavior.floating,
|
behavior: SnackBarBehavior.floating,
|
||||||
@@ -97,7 +97,7 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -122,7 +122,7 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -150,7 +150,7 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -174,7 +174,7 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -198,8 +198,8 @@ class _BlockCardScreen extends State<BlockCardScreen> {
|
|||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
backgroundColor: Colors.blue[900],
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
child: Text(AppLocalizations.of(context).block),
|
child: Text(AppLocalizations.of(context).block),
|
||||||
),
|
),
|
||||||
|
@@ -87,7 +87,7 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -112,7 +112,7 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -140,7 +140,7 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -164,7 +164,7 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -188,8 +188,8 @@ class _CardPinChangeDetailsScreen extends State<CardPinChangeDetailsScreen> {
|
|||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
backgroundColor: Colors.blue[900],
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
child: Text(AppLocalizations.of(context).next),
|
child: Text(AppLocalizations.of(context).next),
|
||||||
),
|
),
|
||||||
|
@@ -25,7 +25,7 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Just close the SnackBar
|
// Just close the SnackBar
|
||||||
},
|
},
|
||||||
textColor: Colors.white,
|
textColor: Theme.of(context).dialogBackgroundColor,
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
behavior: SnackBarBehavior.floating,
|
behavior: SnackBarBehavior.floating,
|
||||||
@@ -87,7 +87,7 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -116,7 +116,7 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -143,8 +143,8 @@ class _CardPinSetScreen extends State<CardPinSetScreen> {
|
|||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
backgroundColor: Colors.blue[900],
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
child: Text(AppLocalizations.of(context).submit),
|
child: Text(AppLocalizations.of(context).submit),
|
||||||
),
|
),
|
||||||
|
@@ -93,9 +93,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
|
|
||||||
Widget _buildBalanceShimmer() {
|
Widget _buildBalanceShimmer() {
|
||||||
return Shimmer.fromColors(
|
return Shimmer.fromColors(
|
||||||
baseColor: Colors.white.withOpacity(0.7),
|
baseColor: Theme.of(context).dialogBackgroundColor,
|
||||||
highlightColor: Colors.white.withOpacity(0.3),
|
highlightColor: Theme.of(context).dialogBackgroundColor,
|
||||||
child: Container(width: 100, height: 32, color: Colors.white),
|
child: Container(width: 100, height: 32, color: Theme.of(context).scaffoldBackgroundColor),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,17 +197,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: const Color(0xfff5f9fc),
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: const Color(0xfff5f9fc),
|
backgroundColor:Theme.of(context).scaffoldBackgroundColor,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: Text(
|
title: Text(
|
||||||
AppLocalizations.of(context).kMobile,
|
AppLocalizations.of(context).kconnect,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).primaryColor,
|
color: Theme.of(context).primaryColor,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
centerTitle: true,
|
||||||
actions: [
|
actions: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 10.0),
|
padding: const EdgeInsets.only(right: 10.0),
|
||||||
@@ -265,7 +266,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
"${AppLocalizations.of(context).hi} $firstName",
|
"${AppLocalizations.of(context).hi} $firstName",
|
||||||
style: GoogleFonts.montserrat().copyWith(
|
style: GoogleFonts.montserrat().copyWith(
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
color: Theme.of(context).primaryColorDark,
|
color: Theme.of(context).primaryColor,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -289,8 +290,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${AppLocalizations.of(context).accountNumber}: ",
|
"${AppLocalizations.of(context).accountNumber}: ",
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -299,9 +300,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
dropdownColor: Theme.of(context).primaryColor,
|
dropdownColor: Theme.of(context).primaryColor,
|
||||||
underline: const SizedBox(),
|
underline: const SizedBox(),
|
||||||
icon: const Icon(Icons.keyboard_arrow_down),
|
icon: const Icon(Icons.keyboard_arrow_down),
|
||||||
iconEnabledColor: Colors.white,
|
iconEnabledColor:Theme.of(context).dialogBackgroundColor,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
),
|
),
|
||||||
items: List.generate(users.length, (index) {
|
items: List.generate(users.length, (index) {
|
||||||
@@ -309,8 +310,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
value: index,
|
value: index,
|
||||||
child: Text(
|
child: Text(
|
||||||
users[index].accountNo ?? 'N/A',
|
users[index].accountNo ?? 'N/A',
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -346,17 +347,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
const Spacer(),
|
const Spacer(),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: isRefreshing
|
icon: isRefreshing
|
||||||
? const SizedBox(
|
? SizedBox(
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: const Icon(
|
: Icon(
|
||||||
Icons.refresh,
|
Icons.refresh,
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
),
|
),
|
||||||
onPressed: isRefreshing
|
onPressed: isRefreshing
|
||||||
? null
|
? null
|
||||||
@@ -367,8 +368,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
getFullAccountType(currAccount.accountType),
|
getFullAccountType(currAccount.accountType),
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -376,10 +377,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Text(
|
Text(
|
||||||
"₹ ",
|
"₹ ",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
@@ -391,8 +392,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
? currAccount.currentBalance ??
|
? currAccount.currentBalance ??
|
||||||
'0.00'
|
'0.00'
|
||||||
: '********',
|
: '********',
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
@@ -422,7 +423,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
isVisible
|
isVisible
|
||||||
? Symbols.visibility_lock
|
? Symbols.visibility_lock
|
||||||
: Symbols.visibility,
|
: Symbols.visibility,
|
||||||
color: Colors.white,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -517,7 +518,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
const ManageBeneficiariesScreen()));
|
const ManageBeneficiariesScreen()));
|
||||||
}, disable: true),
|
}, disable: false),
|
||||||
_buildQuickLink(Symbols.support_agent,
|
_buildQuickLink(Symbols.support_agent,
|
||||||
AppLocalizations.of(context).contactUs, () {
|
AppLocalizations.of(context).contactUs, () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
@@ -598,17 +599,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
leading: Shimmer.fromColors(
|
leading: Shimmer.fromColors(
|
||||||
baseColor: Colors.grey[300]!,
|
baseColor: Colors.grey[300]!,
|
||||||
highlightColor: Colors.grey[100]!,
|
highlightColor: Colors.grey[100]!,
|
||||||
child: const CircleAvatar(radius: 12, backgroundColor: Colors.white),
|
child: CircleAvatar(radius: 12, backgroundColor: Theme.of(context).scaffoldBackgroundColor),
|
||||||
),
|
),
|
||||||
title: Shimmer.fromColors(
|
title: Shimmer.fromColors(
|
||||||
baseColor: Colors.grey[300]!,
|
baseColor: Colors.grey[300]!,
|
||||||
highlightColor: Colors.grey[100]!,
|
highlightColor: Colors.grey[100]!,
|
||||||
child: Container(height: 10, width: 100, color: Colors.white),
|
child: Container(height: 10, width: 100, color: Theme.of(context).scaffoldBackgroundColor),
|
||||||
),
|
),
|
||||||
subtitle: Shimmer.fromColors(
|
subtitle: Shimmer.fromColors(
|
||||||
baseColor: Colors.grey[300]!,
|
baseColor: Colors.grey[300]!,
|
||||||
highlightColor: Colors.grey[100]!,
|
highlightColor: Colors.grey[100]!,
|
||||||
child: Container(height: 8, width: 60, color: Colors.white),
|
child: Container(height: 8, width: 60, color: Theme.of(context).scaffoldBackgroundColor),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@@ -39,8 +39,8 @@ class AccountCard extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
account.accountType,
|
account.accountType,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -49,20 +49,20 @@ class AccountCard extends StatelessWidget {
|
|||||||
account.accountType == 'Savings'
|
account.accountType == 'Savings'
|
||||||
? Icons.savings
|
? Icons.savings
|
||||||
: Icons.account_balance,
|
: Icons.account_balance,
|
||||||
color: Colors.white,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
account.accountNumber,
|
account.accountNumber,
|
||||||
style: const TextStyle(color: Colors.white70, fontSize: 16),
|
style: TextStyle(color: Theme.of(context).dialogBackgroundColor, fontSize: 16),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
Text(
|
Text(
|
||||||
'${account.currency} ${account.balance.toStringAsFixed(2)}',
|
'${account.currency} ${account.balance.toStringAsFixed(2)}',
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -70,7 +70,7 @@ class AccountCard extends StatelessWidget {
|
|||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context).availableBalance,
|
AppLocalizations.of(context).availableBalance,
|
||||||
style: TextStyle(color: Colors.white70, fontSize: 12),
|
style: TextStyle(color: Theme.of(context).dialogBackgroundColor, fontSize: 12),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@@ -38,12 +38,12 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
|||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => _launchEmailAddress(email),
|
onTap: () => _launchEmailAddress(email),
|
||||||
child: Text(email, style: const TextStyle(color: Colors.blue)),
|
child: Text(email, style: TextStyle(color: Theme.of(context).primaryColor)),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => _launchPhoneNumber(phone),
|
onTap: () => _launchPhoneNumber(phone),
|
||||||
child: Text(phone, style: const TextStyle(color: Colors.blue)),
|
child: Text(phone, style: TextStyle(color: Theme.of(context).scaffoldBackgroundColor)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@@ -92,9 +92,9 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
|||||||
style: TextStyle(color: Colors.grey),
|
style: TextStyle(color: Colors.grey),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
const Text(
|
Text(
|
||||||
"complaint@kccb.in",
|
"complaint@kccb.in",
|
||||||
style: TextStyle(color: Colors.blue),
|
style: TextStyle(color: Theme.of(context).primaryColor),
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
/*import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
// import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_screen.dart';
|
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_screen.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
@@ -60,8 +60,8 @@ class _FundTransferBeneficiaryScreen
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final beneficiary = beneficiaries[index];
|
final beneficiary = beneficiaries[index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: const CircleAvatar(
|
leading: CircleAvatar(
|
||||||
backgroundColor: Colors.blue,
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
child: Text('A'),
|
child: Text('A'),
|
||||||
),
|
),
|
||||||
title: Text(beneficiary['name']!),
|
title: Text(beneficiary['name']!),
|
||||||
@@ -84,23 +84,106 @@ class _FundTransferBeneficiaryScreen
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
floatingActionButton: Padding(
|
);
|
||||||
padding: const EdgeInsets.only(bottom: 8.0),
|
}
|
||||||
child: FloatingActionButton(
|
}*/
|
||||||
onPressed: () {
|
|
||||||
Navigator.push(
|
import 'package:flutter/material.dart';
|
||||||
context,
|
import 'package:kmobile/data/models/beneficiary.dart';
|
||||||
MaterialPageRoute(
|
//import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
||||||
builder: (context) => const AddBeneficiaryScreen(),
|
import '../../../l10n/app_localizations.dart';
|
||||||
),
|
import '../../../di/injection.dart';
|
||||||
);
|
import 'package:kmobile/api/services/beneficiary_service.dart';
|
||||||
},
|
import 'package:shimmer/shimmer.dart';
|
||||||
backgroundColor: Colors.grey[300],
|
|
||||||
foregroundColor: Colors.blue[900],
|
|
||||||
elevation: 5,
|
class FundTransferBeneficiaryScreen extends StatefulWidget {
|
||||||
child: const Icon(Icons.add),
|
const FundTransferBeneficiaryScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<FundTransferBeneficiaryScreen> createState() =>
|
||||||
|
_ManageBeneficiariesScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ManageBeneficiariesScreen extends State<FundTransferBeneficiaryScreen> {
|
||||||
|
var service = getIt<BeneficiaryService>();
|
||||||
|
//final BeneficiaryService _service = BeneficiaryService();
|
||||||
|
bool _isLoading = true;
|
||||||
|
List<Beneficiary> _beneficiaries = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_loadBeneficiaries();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _loadBeneficiaries() async {
|
||||||
|
final data = await service.fetchBeneficiaryList();
|
||||||
|
setState(() {
|
||||||
|
_beneficiaries = data ;
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildShimmerList() {
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: 6,
|
||||||
|
itemBuilder: (context, index) => Shimmer.fromColors(
|
||||||
|
baseColor: Colors.grey.shade300,
|
||||||
|
highlightColor: Colors.grey.shade100,
|
||||||
|
child: ListTile(
|
||||||
|
leading: CircleAvatar(
|
||||||
|
radius: 24,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
),
|
||||||
|
title: Container(
|
||||||
|
height: 16,
|
||||||
|
color: Colors.white,
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||||
|
),
|
||||||
|
subtitle: Container(
|
||||||
|
height: 14,
|
||||||
|
color: Colors.white,
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildBeneficiaryList() {
|
||||||
|
if (_beneficiaries.isEmpty) {
|
||||||
|
return Center(child: Text(AppLocalizations.of(context).noBeneficiaryFound));
|
||||||
|
}
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: _beneficiaries.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final item = _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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: Text(item.name ?? 'Unknown'),
|
||||||
|
subtitle: Text(item.accountNo ?? 'No account number'),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(AppLocalizations.of(context).beneficiaries),
|
||||||
|
),
|
||||||
|
body: _isLoading ? _buildShimmerList() : _buildBeneficiaryList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart';
|
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
@@ -135,7 +134,7 @@ class _FundTransferScreen extends State<FundTransferScreen> {
|
|||||||
const Spacer(),
|
const Spacer(),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
color: Colors.white,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
child: GridView.count(
|
child: GridView.count(
|
||||||
crossAxisCount: 3,
|
crossAxisCount: 3,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
@@ -8,8 +8,9 @@ import 'package:lottie/lottie.dart';
|
|||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
import 'package:confetti/confetti.dart';
|
||||||
|
|
||||||
class PaymentAnimationScreen extends StatefulWidget {
|
/*class PaymentAnimationScreen extends StatefulWidget {
|
||||||
final Future<PaymentResponse> paymentResponse;
|
final Future<PaymentResponse> paymentResponse;
|
||||||
|
|
||||||
const PaymentAnimationScreen({super.key, required this.paymentResponse});
|
const PaymentAnimationScreen({super.key, required this.paymentResponse});
|
||||||
@@ -97,7 +98,7 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
|||||||
AppLocalizations.of(
|
AppLocalizations.of(
|
||||||
context,
|
context,
|
||||||
).paymentSuccessful,
|
).paymentSuccessful,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
@@ -133,7 +134,7 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context).paymentFailed,
|
AppLocalizations.of(context).paymentFailed,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
@@ -223,4 +224,238 @@ class _PaymentAnimationScreenState extends State<PaymentAnimationScreen> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
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();
|
||||||
|
late ConfettiController _confettiController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_confettiController = ConfettiController(duration: const Duration(seconds: 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_confettiController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
if (isSuccess) _confettiController.play();
|
||||||
|
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
|
child: ConfettiWidget(
|
||||||
|
confettiController: _confettiController,
|
||||||
|
blastDirectionality: BlastDirectionality.explosive,
|
||||||
|
emissionFrequency: 0.2,
|
||||||
|
numberOfParticles: 40,
|
||||||
|
gravity: 0.3,
|
||||||
|
maxBlastForce: 25,
|
||||||
|
minBlastForce: 10,
|
||||||
|
shouldLoop: false,
|
||||||
|
colors: const [
|
||||||
|
Colors.green,
|
||||||
|
Colors.blue,
|
||||||
|
Colors.pink,
|
||||||
|
Colors.orange,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.check),
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -106,7 +106,7 @@ class _TpinOtpScreenState extends State<TpinOtpScreen> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
counterText: '',
|
counterText: '',
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.blue[50],
|
fillColor: Theme.of(context).primaryColorLight,
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@@ -172,7 +172,7 @@ class _TpinSetScreenState extends State<TpinSetScreen> {
|
|||||||
key == '<' ? '⌫' : key,
|
key == '<' ? '⌫' : key,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: key == 'Enter' ? Colors.blue : Colors.black,
|
color: key == 'Enter' ? Theme.of(context).primaryColor : Colors.black,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -201,7 +201,7 @@ class _TpinSetScreenState extends State<TpinSetScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
const Icon(Icons.lock_outline, size: 60, color: Colors.blue),
|
Icon(Icons.lock_outline, size: 60, color: Theme.of(context).primaryColor),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
getTitle(),
|
getTitle(),
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: unused_field
|
||||||
|
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -7,7 +9,6 @@ import 'package:kmobile/data/models/transfer.dart';
|
|||||||
import 'package:kmobile/di/injection.dart';
|
import 'package:kmobile/di/injection.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/payment_animation.dart';
|
import 'package:kmobile/features/fund_transfer/screens/payment_animation.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/tpin_prompt_screen.dart';
|
import 'package:kmobile/features/fund_transfer/screens/tpin_prompt_screen.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/transaction_success_screen.dart';
|
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
|
||||||
class TransactionPinScreen extends StatefulWidget {
|
class TransactionPinScreen extends StatefulWidget {
|
||||||
@@ -73,8 +74,8 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
|||||||
height: 20,
|
height: 20,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
border: Border.all(color: Colors.blue, width: 2),
|
border: Border.all(color: Theme.of(context).primaryColor, width: 2),
|
||||||
color: index < _pin.length ? Colors.blue : Colors.transparent,
|
color: index < _pin.length ? Theme.of(context).primaryColor : Colors.transparent,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
@@ -50,10 +50,10 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const CircleAvatar(
|
CircleAvatar(
|
||||||
radius: 50,
|
radius: 50,
|
||||||
backgroundColor: Colors.blue,
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
child: Icon(Icons.check, color: Colors.white, size: 60),
|
child: Icon(Icons.check, color: Theme.of(context).scaffoldBackgroundColor, size: 60),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
Text(
|
Text(
|
||||||
@@ -92,8 +92,8 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
|
|||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
foregroundColor: Colors.blueAccent,
|
foregroundColor: Theme.of(context).primaryColorLight,
|
||||||
side: const BorderSide(color: Colors.black, width: 1),
|
side: const BorderSide(color: Colors.black, width: 1),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
),
|
||||||
@@ -114,8 +114,8 @@ class _TransactionSuccessScreen extends State<TransactionSuccessScreen> {
|
|||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
backgroundColor: Colors.blue[900],
|
backgroundColor: Theme.of(context).primaryColorDark,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
child: Text(AppLocalizations.of(context).done),
|
child: Text(AppLocalizations.of(context).done),
|
||||||
),
|
),
|
||||||
|
51
lib/features/profile/preferences/color_theme_dialog.dart
Normal file
51
lib/features/profile/preferences/color_theme_dialog.dart
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:kmobile/config/theme_type.dart';
|
||||||
|
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
||||||
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
class ColorThemeDialog extends StatelessWidget {
|
||||||
|
const ColorThemeDialog({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SimpleDialog(
|
||||||
|
title: Text(AppLocalizations.of(context).selectThemeColor),
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
leading: const CircleAvatar(backgroundColor: Colors.deepPurple),
|
||||||
|
title: Text(AppLocalizations.of(context).violet),
|
||||||
|
onTap: () {
|
||||||
|
context.read<ThemeCubit>().changeTheme(ThemeType.violet);
|
||||||
|
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),
|
||||||
|
onTap: () {
|
||||||
|
context.read<ThemeCubit>().changeTheme(ThemeType.blue);
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -1,49 +1,37 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
import 'package:kmobile/app.dart';
|
import 'package:kmobile/app.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class LanguageDialog extends StatelessWidget {
|
class LanguageDialog extends StatelessWidget {
|
||||||
const LanguageDialog({super.key});
|
const LanguageDialog({Key? key}) : super(key: key);
|
||||||
|
|
||||||
String getLocaleName(AppLocalizations localizations, String code) {
|
Future<void> _setLocale(BuildContext context, String langCode) async {
|
||||||
final localeCodeMap = {
|
final prefs = await SharedPreferences.getInstance();
|
||||||
'en': localizations.english,
|
await prefs.setString('locale', langCode); // Save selected language
|
||||||
'hi': localizations.hindi,
|
KMobile.setLocale(context, Locale(langCode)); // Update locale in app
|
||||||
};
|
Navigator.of(context).pop(); // Close the dialog
|
||||||
return localeCodeMap[code] ?? 'Unknown';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Builder(
|
return AlertDialog(
|
||||||
builder: (context) {
|
title: Text(AppLocalizations.of(context).selectLanguage),
|
||||||
final localizations = AppLocalizations.of(context);
|
content: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
final supportedLocales = [const Locale('en'), const Locale('hi')];
|
children: [
|
||||||
|
ListTile(
|
||||||
return AlertDialog(
|
leading: const Icon(Icons.language),
|
||||||
title: Text(localizations.language),
|
title: const Text('English'),
|
||||||
content: Column(
|
onTap: () => _setLocale(context, 'en'),
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: supportedLocales.map((locale) {
|
|
||||||
return ListTile(
|
|
||||||
leading: const Icon(Icons.language),
|
|
||||||
title: Text(getLocaleName(localizations, locale.languageCode)),
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
KMobile.setLocale(context, locale);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
),
|
||||||
actions: [
|
ListTile(
|
||||||
TextButton(
|
leading: const Icon(Icons.language),
|
||||||
onPressed: () => Navigator.pop(context),
|
title: const Text('हिन्दी'),
|
||||||
child: Text(localizations.cancel),
|
onTap: () => _setLocale(context, 'hi'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
),
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,6 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'language_dialog.dart';
|
import 'language_dialog.dart';
|
||||||
|
import 'color_theme_dialog.dart';
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
||||||
|
import 'package:kmobile/features/auth/controllers/theme_state.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
class PreferenceScreen extends StatelessWidget {
|
class PreferenceScreen extends StatelessWidget {
|
||||||
const PreferenceScreen({super.key});
|
const PreferenceScreen({super.key});
|
||||||
@@ -11,21 +15,48 @@ class PreferenceScreen extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(loc.preferences), // Localized "Preferences"
|
title: Text(loc.preferences),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: BlocBuilder<ThemeCubit, ThemeState>(
|
||||||
children: [
|
builder: (context, state) {
|
||||||
ListTile(
|
return ListView(
|
||||||
leading: const Icon(Icons.language),
|
children: [
|
||||||
title: Text(loc.language), // Localized "Language"
|
// 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: () {
|
onTap: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => LanguageDialog(),
|
builder: (_) => const ColorThemeDialog(),
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
),
|
),
|
||||||
],
|
// Language Selection
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.language),
|
||||||
|
title: Text(loc.language),
|
||||||
|
onTap: () {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => const LanguageDialog(), // your custom language dialog
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (_) => const PreferenceScreen()),
|
MaterialPageRoute(builder: (context) => const PreferenceScreen()),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@@ -122,7 +122,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -152,7 +152,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -179,7 +179,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -204,7 +204,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -228,7 +228,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -255,7 +255,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -282,7 +282,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -320,7 +320,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -342,7 +342,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -382,9 +382,9 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: SwipeButton.expand(
|
child: SwipeButton.expand(
|
||||||
thumb: const Icon(Icons.arrow_forward, color: Colors.white),
|
thumb: Icon(Icons.arrow_forward, color: Theme.of(context).scaffoldBackgroundColor),
|
||||||
activeThumbColor: Colors.blue[900],
|
activeThumbColor: Theme.of(context).primaryColorDark,
|
||||||
activeTrackColor: Colors.blue.shade100,
|
activeTrackColor: Theme.of(context).primaryColorLight,
|
||||||
borderRadius: BorderRadius.circular(30),
|
borderRadius: BorderRadius.circular(30),
|
||||||
height: 56,
|
height: 56,
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -438,10 +438,10 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
margin: const EdgeInsets.symmetric(horizontal: 4),
|
margin: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isSelected ? Colors.blue[200] : Colors.white,
|
color: isSelected ? Theme.of(context).primaryColor : Theme.of(context).scaffoldBackgroundColor,
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isSelected ? Colors.blue : Colors.grey,
|
color: isSelected ? Theme.of(context).primaryColor : Theme.of(context).scaffoldBackgroundColor,
|
||||||
width: isSelected ? 0 : 1.2,
|
width: isSelected ? 0 : 1.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@@ -7,6 +7,7 @@ import 'package:kmobile/di/injection.dart';
|
|||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
import '../../fund_transfer/screens/transaction_pin_screen.dart';
|
import '../../fund_transfer/screens/transaction_pin_screen.dart';
|
||||||
|
//import 'package:flutter_neumorphic/flutter_neumorphic.dart';
|
||||||
|
|
||||||
class QuickPayWithinBankScreen extends StatefulWidget {
|
class QuickPayWithinBankScreen extends StatefulWidget {
|
||||||
final String debitAccount;
|
final String debitAccount;
|
||||||
@@ -128,7 +129,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
controller: TextEditingController(text: widget.debitAccount),
|
controller: TextEditingController(text: widget.debitAccount),
|
||||||
@@ -143,7 +144,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: const OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -182,7 +183,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: const OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -264,7 +265,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: const OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -311,7 +312,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: const OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
@@ -337,7 +338,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: SwipeButton.expand(
|
child: SwipeButton.expand(
|
||||||
thumb: const Icon(Icons.arrow_forward, color: Colors.white),
|
thumb: Icon(Icons.arrow_forward, color: Theme.of(context).dialogBackgroundColor),
|
||||||
activeThumbColor: Theme.of(context).primaryColor,
|
activeThumbColor: Theme.of(context).primaryColor,
|
||||||
activeTrackColor: Theme.of(
|
activeTrackColor: Theme.of(
|
||||||
context,
|
context,
|
||||||
@@ -375,6 +376,54 @@ 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(
|
// SliderButton(
|
||||||
// action: () async {
|
// action: () async {
|
||||||
// ///Do something here OnSlide
|
// ///Do something here OnSlide
|
||||||
@@ -412,7 +461,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Theme.of(context).dialogBackgroundColor,
|
||||||
enabledBorder: const OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
|
@@ -219,6 +219,16 @@
|
|||||||
"setMPIN": "Set your mPIN",
|
"setMPIN": "Set your mPIN",
|
||||||
"confirmMPIN": "Confirm your mPIN",
|
"confirmMPIN": "Confirm your mPIN",
|
||||||
"kconnect": "Kconnect",
|
"kconnect": "Kconnect",
|
||||||
"kccBankFull": "Kangra Central Co-operative Bank"
|
"kccBankFull": "Kangra Central Co-operative Bank",
|
||||||
|
"themeColor": "Theme Color",
|
||||||
|
"selectThemeColor": "Select Theme Color",
|
||||||
|
"violet": "Violet",
|
||||||
|
"blue": "Blue",
|
||||||
|
"invalidIfsc": "Invalid IFSC code",
|
||||||
|
"validIfsc": "Valid IFSC",
|
||||||
|
"beneficiaryAddedSuccess": "Beneficiary Added Successfully",
|
||||||
|
"beneficiaryAdditionFailed": "Beneficiary Addition Failed",
|
||||||
|
"noBeneficiaryFound": "No beneficiaries found",
|
||||||
|
"beneficiaryName": "Beneficiary Name"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -218,6 +218,16 @@
|
|||||||
"enterMPIN": "अपना mPIN दर्ज करें",
|
"enterMPIN": "अपना mPIN दर्ज करें",
|
||||||
"setMPIN": "अपना mPIN सेट करें",
|
"setMPIN": "अपना mPIN सेट करें",
|
||||||
"confirmMPIN": "अपना mPIN की पुष्टि करें",
|
"confirmMPIN": "अपना mPIN की पुष्टि करें",
|
||||||
"kconnect": "केकनेक्ट",
|
"kconnect": "के-कनेक्ट",
|
||||||
"kccBankFull": "कांगड़ा सेंट्रल को-ऑपरेटिव बैंक"
|
"kccBankFull": "कांगड़ा सेंट्रल को-ऑपरेटिव बैंक",
|
||||||
|
"themeColor": "थीम रंग",
|
||||||
|
"selectThemeColor": "थीम रंग चुनें",
|
||||||
|
"violet": "बैंगनी",
|
||||||
|
"blue": "नीला",
|
||||||
|
"invalidIfsc": "अमान्य IFSC कोड",
|
||||||
|
"validIfsc": "मान्य IFSC",
|
||||||
|
"beneficiaryAddedSuccess": "लाभार्थी सफलतापूर्वक जोड़ा गया",
|
||||||
|
"beneficiaryAdditionFailed": "लाभार्थी जोड़ने में विफल",
|
||||||
|
"noBeneficiaryFound": "कोई लाभार्थी नहीं मिला",
|
||||||
|
"beneficiaryName": "लाभार्थी नाम"
|
||||||
}
|
}
|
||||||
|
@@ -62,8 +62,7 @@ import 'app_localizations_hi.dart';
|
|||||||
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
|
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
|
||||||
/// property.
|
/// property.
|
||||||
abstract class AppLocalizations {
|
abstract class AppLocalizations {
|
||||||
AppLocalizations(String locale)
|
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
|
||||||
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
|
|
||||||
|
|
||||||
final String localeName;
|
final String localeName;
|
||||||
|
|
||||||
@@ -71,8 +70,7 @@ abstract class AppLocalizations {
|
|||||||
return Localizations.of<AppLocalizations>(context, AppLocalizations)!;
|
return Localizations.of<AppLocalizations>(context, AppLocalizations)!;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const LocalizationsDelegate<AppLocalizations> delegate =
|
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
|
||||||
_AppLocalizationsDelegate();
|
|
||||||
|
|
||||||
/// A list of this localizations delegate along with the default localizations
|
/// A list of this localizations delegate along with the default localizations
|
||||||
/// delegates.
|
/// delegates.
|
||||||
@@ -84,8 +82,7 @@ abstract class AppLocalizations {
|
|||||||
/// Additional delegates can be added by appending to this list in
|
/// Additional delegates can be added by appending to this list in
|
||||||
/// MaterialApp. This list does not have to be used at all if a custom list
|
/// MaterialApp. This list does not have to be used at all if a custom list
|
||||||
/// of delegates is preferred or required.
|
/// of delegates is preferred or required.
|
||||||
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
|
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
|
||||||
<LocalizationsDelegate<dynamic>>[
|
|
||||||
delegate,
|
delegate,
|
||||||
GlobalMaterialLocalizations.delegate,
|
GlobalMaterialLocalizations.delegate,
|
||||||
GlobalCupertinoLocalizations.delegate,
|
GlobalCupertinoLocalizations.delegate,
|
||||||
@@ -1345,10 +1342,69 @@ abstract class AppLocalizations {
|
|||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'Kangra Central Co-operative Bank'**
|
/// **'Kangra Central Co-operative Bank'**
|
||||||
String get kccBankFull;
|
String get kccBankFull;
|
||||||
|
|
||||||
|
/// No description provided for @themeColor.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Theme Color'**
|
||||||
|
String get themeColor;
|
||||||
|
|
||||||
|
/// No description provided for @selectThemeColor.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Select Theme Color'**
|
||||||
|
String get selectThemeColor;
|
||||||
|
|
||||||
|
/// No description provided for @violet.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Violet'**
|
||||||
|
String get violet;
|
||||||
|
|
||||||
|
/// No description provided for @blue.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Blue'**
|
||||||
|
String get blue;
|
||||||
|
|
||||||
|
/// No description provided for @invalidIfsc.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Invalid IFSC code'**
|
||||||
|
String get invalidIfsc;
|
||||||
|
|
||||||
|
/// No description provided for @validIfsc.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Valid IFSC'**
|
||||||
|
String get validIfsc;
|
||||||
|
|
||||||
|
/// No description provided for @beneficiaryAddedSuccess.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Beneficiary Added Successfully'**
|
||||||
|
String get beneficiaryAddedSuccess;
|
||||||
|
|
||||||
|
/// No description provided for @beneficiaryAdditionFailed.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Beneficiary Addition Failed'**
|
||||||
|
String get beneficiaryAdditionFailed;
|
||||||
|
|
||||||
|
/// No description provided for @noBeneficiaryFound.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'No beneficiaries found'**
|
||||||
|
String get noBeneficiaryFound;
|
||||||
|
|
||||||
|
/// No description provided for @beneficiaryName.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Beneficiary Name'**
|
||||||
|
String get beneficiaryName;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AppLocalizationsDelegate
|
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
|
||||||
extends LocalizationsDelegate<AppLocalizations> {
|
|
||||||
const _AppLocalizationsDelegate();
|
const _AppLocalizationsDelegate();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -1357,25 +1413,25 @@ class _AppLocalizationsDelegate
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool isSupported(Locale locale) =>
|
bool isSupported(Locale locale) => <String>['en', 'hi'].contains(locale.languageCode);
|
||||||
<String>['en', 'hi'].contains(locale.languageCode);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool shouldReload(_AppLocalizationsDelegate old) => false;
|
bool shouldReload(_AppLocalizationsDelegate old) => false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppLocalizations lookupAppLocalizations(Locale locale) {
|
AppLocalizations lookupAppLocalizations(Locale locale) {
|
||||||
|
|
||||||
|
|
||||||
// Lookup logic when only language code is specified.
|
// Lookup logic when only language code is specified.
|
||||||
switch (locale.languageCode) {
|
switch (locale.languageCode) {
|
||||||
case 'en':
|
case 'en': return AppLocalizationsEn();
|
||||||
return AppLocalizationsEn();
|
case 'hi': return AppLocalizationsHi();
|
||||||
case 'hi':
|
|
||||||
return AppLocalizationsHi();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw FlutterError(
|
throw FlutterError(
|
||||||
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
|
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
|
||||||
'an issue with the localizations generation tool. Please file an issue '
|
'an issue with the localizations generation tool. Please file an issue '
|
||||||
'on GitHub with a reproducible sample app and the gen-l10n configuration '
|
'on GitHub with a reproducible sample app and the gen-l10n configuration '
|
||||||
'that was used.');
|
'that was used.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
// ignore: unused_import
|
|
||||||
import 'package:intl/intl.dart' as intl;
|
|
||||||
import 'app_localizations.dart';
|
import 'app_localizations.dart';
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
@@ -488,8 +486,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
String get otpVerification => 'OTP Verification';
|
String get otpVerification => 'OTP Verification';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get otpSentMessage =>
|
String get otpSentMessage => 'Enter the 4-digit OTP sent to your mobile number';
|
||||||
'Enter the 4-digit OTP sent to your mobile number';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get verifyOtp => 'Verify OTP';
|
String get verifyOtp => 'Verify OTP';
|
||||||
@@ -507,15 +504,13 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
String get tpinRequired => 'TPIN Required';
|
String get tpinRequired => 'TPIN Required';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get tpinRequiredMessage =>
|
String get tpinRequiredMessage => 'You need to set your TPIN to continue with secure transactions';
|
||||||
'You need to set your TPIN to continue with secure transactions';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get setTpinTitle => 'Set TPIN';
|
String get setTpinTitle => 'Set TPIN';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get tpinInfo =>
|
String get tpinInfo => 'Your TPIN is a 6-digit code used to authorize transactions. Keep it safe and do not share it with anyone.';
|
||||||
'Your TPIN is a 6-digit code used to authorize transactions. Keep it safe and do not share it with anyone.';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get tpinFailed => 'Failed to set TPIN. Please try again.';
|
String get tpinFailed => 'Failed to set TPIN. Please try again.';
|
||||||
@@ -569,8 +564,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
String get enableFingerprintLogin => 'Enable Fingerprint Login?';
|
String get enableFingerprintLogin => 'Enable Fingerprint Login?';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get enableFingerprintMessage =>
|
String get enableFingerprintMessage => 'Would you like to enable fingerprint authentication for faster login?';
|
||||||
'Would you like to enable fingerprint authentication for faster login?';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get no => 'No';
|
String get no => 'No';
|
||||||
@@ -591,8 +585,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
String get loading => 'Loading......';
|
String get loading => 'Loading......';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get enableFingerprintQuick =>
|
String get enableFingerprintQuick => 'Enable fingerprint authentication for quick login?';
|
||||||
'Enable fingerprint authentication for quick login?';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get kccb => 'KCCB';
|
String get kccb => 'KCCB';
|
||||||
@@ -638,4 +631,34 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String get kccBankFull => 'Kangra Central Co-operative Bank';
|
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,5 +1,3 @@
|
|||||||
// ignore: unused_import
|
|
||||||
import 'package:intl/intl.dart' as intl;
|
|
||||||
import 'app_localizations.dart';
|
import 'app_localizations.dart';
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
@@ -54,8 +52,7 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||||||
String get enableBiometric => 'बायोमेट्रिक प्रमाणीकरण सक्षम करें';
|
String get enableBiometric => 'बायोमेट्रिक प्रमाणीकरण सक्षम करें';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get useBiometricPrompt =>
|
String get useBiometricPrompt => 'तेज़ लॉगिन के लिए फिंगरप्रिंट/फेस आईडी का उपयोग करें?';
|
||||||
'तेज़ लॉगिन के लिए फिंगरप्रिंट/फेस आईडी का उपयोग करें?';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get later => 'बाद में';
|
String get later => 'बाद में';
|
||||||
@@ -489,8 +486,7 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||||||
String get otpVerification => 'ओटीपी सत्यापन';
|
String get otpVerification => 'ओटीपी सत्यापन';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get otpSentMessage =>
|
String get otpSentMessage => 'अपने मोबाइल नंबर पर भेजा गया 4-अंकों का ओटीपी दर्ज करें';
|
||||||
'अपने मोबाइल नंबर पर भेजा गया 4-अंकों का ओटीपी दर्ज करें';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get verifyOtp => 'ओटीपी सत्यापित करें';
|
String get verifyOtp => 'ओटीपी सत्यापित करें';
|
||||||
@@ -508,15 +504,13 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||||||
String get tpinRequired => 'टी-पिन आवश्यक है';
|
String get tpinRequired => 'टी-पिन आवश्यक है';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get tpinRequiredMessage =>
|
String get tpinRequiredMessage => 'सुरक्षित लेनदेन के लिए टी-पिन सेट करना आवश्यक है';
|
||||||
'सुरक्षित लेनदेन के लिए टी-पिन सेट करना आवश्यक है';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get setTpinTitle => 'टी-पिन सेट करें';
|
String get setTpinTitle => 'टी-पिन सेट करें';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get tpinInfo =>
|
String get tpinInfo => 'आपका टी-पिन 6 अंकों का कोड है जिसका उपयोग लेन-देन को प्रमाणित करने के लिए किया जाता है। इसे सुरक्षित रखें और किसी से साझा न करें।';
|
||||||
'आपका टी-पिन 6 अंकों का कोड है जिसका उपयोग लेन-देन को प्रमाणित करने के लिए किया जाता है। इसे सुरक्षित रखें और किसी से साझा न करें।';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get tpinFailed => 'टी-पिन सेट करने में विफल। कृपया पुनः प्रयास करें।';
|
String get tpinFailed => 'टी-पिन सेट करने में विफल। कृपया पुनः प्रयास करें।';
|
||||||
@@ -570,8 +564,7 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||||||
String get enableFingerprintLogin => 'फिंगरप्रिंट लॉगिन सक्षम करें?';
|
String get enableFingerprintLogin => 'फिंगरप्रिंट लॉगिन सक्षम करें?';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get enableFingerprintMessage =>
|
String get enableFingerprintMessage => 'क्या आप तेज लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करना चाहेंगे?';
|
||||||
'क्या आप तेज लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करना चाहेंगे?';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get no => 'नहीं';
|
String get no => 'नहीं';
|
||||||
@@ -580,8 +573,7 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||||||
String get yes => 'हाँ';
|
String get yes => 'हाँ';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get authenticateToEnable =>
|
String get authenticateToEnable => 'फिंगरप्रिंट लॉगिन सक्षम करने के लिए प्रमाणीकरण करें';
|
||||||
'फिंगरप्रिंट लॉगिन सक्षम करने के लिए प्रमाणीकरण करें';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get exitApp => 'ऐप बंद करें';
|
String get exitApp => 'ऐप बंद करें';
|
||||||
@@ -593,8 +585,7 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||||||
String get loading => 'लोड हो रहा है......';
|
String get loading => 'लोड हो रहा है......';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get enableFingerprintQuick =>
|
String get enableFingerprintQuick => 'तेज़ लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करें?';
|
||||||
'तेज़ लॉगिन के लिए फिंगरप्रिंट प्रमाणीकरण सक्षम करें?';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get kccb => 'केसीसीबी';
|
String get kccb => 'केसीसीबी';
|
||||||
@@ -636,8 +627,38 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||||||
String get confirmMPIN => 'अपना mPIN की पुष्टि करें';
|
String get confirmMPIN => 'अपना mPIN की पुष्टि करें';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get kconnect => 'केकनेक्ट';
|
String get kconnect => 'के-कनेक्ट';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get kccBankFull => 'कांगड़ा सेंट्रल को-ऑपरेटिव बैंक';
|
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 => 'लाभार्थी नाम';
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,5 @@ void main() async {
|
|||||||
|
|
||||||
// Initialize dependencies
|
// Initialize dependencies
|
||||||
await setupDependencies();
|
await setupDependencies();
|
||||||
|
|
||||||
runApp(const KMobile());
|
runApp(const KMobile());
|
||||||
}
|
}
|
||||||
|
104
pubspec.lock
104
pubspec.lock
@@ -21,10 +21,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.13.0"
|
version: "2.11.0"
|
||||||
bloc:
|
bloc:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -37,10 +37,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: boolean_selector
|
name: boolean_selector
|
||||||
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.1"
|
||||||
chalkdart:
|
chalkdart:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -53,10 +53,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.3.0"
|
||||||
checked_yaml:
|
checked_yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -77,18 +77,26 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.1.1"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.19.1"
|
version: "1.18.0"
|
||||||
|
confetti:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: confetti
|
||||||
|
sha256: "979aafde2428c53947892c95eb244466c109c129b7eee9011f0a66caaca52267"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.7.0"
|
||||||
cross_file:
|
cross_file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -141,10 +149,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.3"
|
version: "1.3.1"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -203,6 +211,14 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_neumorphic:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_neumorphic
|
||||||
|
sha256: "02606d937a3ceaa497b8a7c25f3efa95188bf93d77ebf0bd6552e432db4c2ec6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.0"
|
||||||
flutter_plugin_android_lifecycle:
|
flutter_plugin_android_lifecycle:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -289,10 +305,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: get_it
|
name: get_it
|
||||||
sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103
|
sha256: e87cd1d108e472a0580348a543a0c49ed3d70c8a5c809c6d418583e595d0a389
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.0.3"
|
version: "8.1.0"
|
||||||
glob:
|
glob:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -337,10 +353,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: intl
|
name: intl
|
||||||
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
|
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.20.2"
|
version: "0.19.0"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -361,18 +377,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.0.9"
|
version: "10.0.5"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker_flutter_testing
|
name: leak_tracker_flutter_testing
|
||||||
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
|
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.9"
|
version: "3.0.5"
|
||||||
leak_tracker_testing:
|
leak_tracker_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -441,10 +457,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.17"
|
version: "0.12.16+1"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -457,18 +473,18 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: material_symbols_icons
|
name: material_symbols_icons
|
||||||
sha256: "7c50901b39d1ad645ee25d920aed008061e1fd541a897b4ebf2c01d966dbf16b"
|
sha256: ef20d86fb34c2b59eb7553c4d795bb8a7ec8c890c53ffd3148c64f7adc46ae50
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2815.1"
|
version: "4.2858.1"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.15.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -489,10 +505,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
version: "1.9.0"
|
||||||
path_parsing:
|
path_parsing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -673,15 +689,15 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.99"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
|
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.1"
|
version: "1.10.0"
|
||||||
sprintf:
|
sprintf:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -694,42 +710,42 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.12.1"
|
version: "1.11.1"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stream_channel
|
name: stream_channel
|
||||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.2"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.1"
|
version: "1.2.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: term_glyph
|
name: term_glyph
|
||||||
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.2"
|
version: "1.2.1"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
|
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.4"
|
version: "0.7.2"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -846,10 +862,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "15.0.0"
|
version: "14.2.5"
|
||||||
web:
|
web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -891,5 +907,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.3"
|
version: "3.1.3"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.7.0-0 <4.0.0"
|
dart: ">=3.5.0 <4.0.0"
|
||||||
flutter: ">=3.24.0"
|
flutter: ">=3.24.0"
|
||||||
|
@@ -30,6 +30,7 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_neumorphic : 3.2.0
|
||||||
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
@@ -57,6 +58,7 @@ dependencies:
|
|||||||
shimmer: ^3.0.0
|
shimmer: ^3.0.0
|
||||||
lottie: ^2.6.0
|
lottie: ^2.6.0
|
||||||
share_plus: ^7.2.1
|
share_plus: ^7.2.1
|
||||||
|
confetti: ^0.7.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user