reports page implementation

This commit is contained in:
2026-02-18 15:10:01 +05:30
parent fe87291651
commit d589c9bca2
51 changed files with 5325 additions and 11 deletions

View File

@@ -40,7 +40,11 @@ void main() async {
/// The main application module.
class AppModule extends Module {
@override
List<Module> get imports => <Module>[core_localization.LocalizationModule()];
List<Module> get imports =>
<Module>[
core_localization.LocalizationModule(),
staff_authentication.StaffAuthenticationModule(),
];
@override
void routes(RouteManager r) {

View File

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_core/core.dart';
import 'package:krow_data_connect/krow_data_connect.dart';
import 'package:staff_authentication/staff_authentication.dart';
/// A widget that listens to session state changes and handles global reactions.
///
@@ -40,7 +41,7 @@ class _SessionListenerState extends State<SessionListener> {
debugPrint('[SessionListener] Initialized session listener');
}
void _handleSessionChange(SessionState state) {
Future<void> _handleSessionChange(SessionState state) async {
if (!mounted) return;
switch (state.type) {
@@ -65,6 +66,19 @@ class _SessionListenerState extends State<SessionListener> {
_sessionExpiredDialogShown = false;
debugPrint('[SessionListener] Authenticated: ${state.userId}');
if (StaffSessionStore.instance.session == null) {
try {
final AuthRepositoryInterface authRepo =
Modular.get<AuthRepositoryInterface>();
await authRepo.restoreSession();
} catch (e) {
if (mounted) {
_proceedToLogin();
}
return;
}
}
// Navigate to the main app
Modular.to.toStaffHome();
break;