3 changes
This commit is contained in:
15
lib/app.dart
15
lib/app.dart
@@ -13,7 +13,6 @@ import 'config/routes.dart';
|
|||||||
import 'di/injection.dart';
|
import 'di/injection.dart';
|
||||||
import 'features/auth/controllers/auth_cubit.dart';
|
import 'features/auth/controllers/auth_cubit.dart';
|
||||||
import 'features/card/screens/card_management_screen.dart';
|
import 'features/card/screens/card_management_screen.dart';
|
||||||
import 'features/auth/screens/splash_screen.dart';
|
|
||||||
import 'features/auth/screens/login_screen.dart';
|
import 'features/auth/screens/login_screen.dart';
|
||||||
import 'features/service/screens/service_screen.dart';
|
import 'features/service/screens/service_screen.dart';
|
||||||
import 'features/dashboard/screens/dashboard_screen.dart';
|
import 'features/dashboard/screens/dashboard_screen.dart';
|
||||||
@@ -37,7 +36,6 @@ class KMobile extends StatefulWidget {
|
|||||||
|
|
||||||
class _KMobileState extends State<KMobile> with WidgetsBindingObserver {
|
class _KMobileState extends State<KMobile> with WidgetsBindingObserver {
|
||||||
Timer? _backgroundTimer;
|
Timer? _backgroundTimer;
|
||||||
bool showSplash = true;
|
|
||||||
Locale? _locale;
|
Locale? _locale;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -45,11 +43,6 @@ class _KMobileState extends State<KMobile> with WidgetsBindingObserver {
|
|||||||
super.initState();
|
super.initState();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
loadPreferences();
|
loadPreferences();
|
||||||
Future.delayed(const Duration(seconds: 3), () {
|
|
||||||
setState(() {
|
|
||||||
showSplash = false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -133,7 +126,7 @@ class _KMobileState extends State<KMobile> with WidgetsBindingObserver {
|
|||||||
themeMode: context.watch<ThemeModeCubit>().state.mode,
|
themeMode: context.watch<ThemeModeCubit>().state.mode,
|
||||||
onGenerateRoute: AppRoutes.generateRoute,
|
onGenerateRoute: AppRoutes.generateRoute,
|
||||||
initialRoute: AppRoutes.splash,
|
initialRoute: AppRoutes.splash,
|
||||||
home: showSplash ? const SplashScreen() : const AuthGate(),
|
home: const AuthGate(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -205,7 +198,7 @@ class _AuthGateState extends State<AuthGate> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_checking) {
|
if (_checking) {
|
||||||
return const SplashScreen();
|
return const LoginScreen();
|
||||||
}
|
}
|
||||||
if (_isLoggedIn) {
|
if (_isLoggedIn) {
|
||||||
if (_hasMPin) {
|
if (_hasMPin) {
|
||||||
@@ -214,7 +207,7 @@ class _AuthGateState extends State<AuthGate> {
|
|||||||
future: _tryBiometric(),
|
future: _tryBiometric(),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
return const SplashScreen();
|
return const LoginScreen();
|
||||||
}
|
}
|
||||||
if (snapshot.data == true) {
|
if (snapshot.data == true) {
|
||||||
return const NavigationScaffold();
|
return const NavigationScaffold();
|
||||||
@@ -422,7 +415,7 @@ class BiometricPromptScreen extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Future.microtask(() => _showDialog(context));
|
Future.microtask(() => _showDialog(context));
|
||||||
return const SplashScreen();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showDialog(BuildContext context) async {
|
Future<void> _showDialog(BuildContext context) async {
|
||||||
|
|||||||
@@ -100,9 +100,11 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
final maxToDate = fromDate!.add(const Duration(days: 183)).isBefore(now)
|
final maxToDate = fromDate!.add(const Duration(days: 183)).isBefore(now)
|
||||||
? fromDate!.add(const Duration(days: 183))
|
? fromDate!.add(const Duration(days: 183))
|
||||||
: now;
|
: now;
|
||||||
|
final initialToDate = toDate ?? now;
|
||||||
|
final clampedInitialToDate = initialToDate.isBefore(fromDate!) ? fromDate! : initialToDate;
|
||||||
final picked = await showDatePicker(
|
final picked = await showDatePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialDate: toDate ?? fromDate!,
|
initialDate: clampedInitialToDate,
|
||||||
firstDate: fromDate!,
|
firstDate: fromDate!,
|
||||||
lastDate: maxToDate,
|
lastDate: maxToDate,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
|||||||
value: user.branchId ?? 'N/A',
|
value: user.branchId ?? 'N/A',
|
||||||
),
|
),
|
||||||
InfoField(
|
InfoField(
|
||||||
label: AppLocalizations.of(context).branchAddress,
|
label: AppLocalizations.of(context).address,
|
||||||
value: user.address ?? 'N/A',
|
value: user.address ?? 'N/A',
|
||||||
), // Replace with Aadhar if available
|
), // Replace with Aadhar if available
|
||||||
InfoField(
|
InfoField(
|
||||||
|
|||||||
@@ -404,5 +404,6 @@
|
|||||||
"postOffice": "Post Office",
|
"postOffice": "Post Office",
|
||||||
"rbiCode1": "RBI Code 1",
|
"rbiCode1": "RBI Code 1",
|
||||||
"rbiCode2": "RBI Code 2",
|
"rbiCode2": "RBI Code 2",
|
||||||
"latitude": "Latitude"
|
"latitude": "Latitude",
|
||||||
|
"address": "Customer Address"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -405,5 +405,6 @@
|
|||||||
"postOffice": "डाकघर",
|
"postOffice": "डाकघर",
|
||||||
"rbiCode1": "आरबीआई कोड 1",
|
"rbiCode1": "आरबीआई कोड 1",
|
||||||
"rbiCode2": "आरबीआई कोड 2",
|
"rbiCode2": "आरबीआई कोड 2",
|
||||||
"latitude": "अक्षांश"
|
"latitude": "अक्षांश",
|
||||||
|
"address": "ग्राहक का पता"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user