This commit is contained in:
2026-05-19 12:46:13 +02:00
parent 3f2f55d6c2
commit 3ecf617998
10 changed files with 313 additions and 16 deletions

View File

@@ -18,7 +18,7 @@ class LatestStoreOperationsCard extends StatelessWidget {
// 1. Creiamo il Bloc e facciamo partire subito la query
create: (context) =>
LatestStoreOperationsBloc()
..add(InitLastStoreOperationsEvent(currentStoreId ?? '')),
..add(InitLatestStoreOperationsEvent(currentStoreId ?? '')),
child: BlocListener<SessionCubit, SessionState>(
// 2. MAGIA: Se l'utente cambia negozio dalla barra in alto, riavviamo lo stream!
listenWhen: (previous, current) =>
@@ -26,7 +26,7 @@ class LatestStoreOperationsCard extends StatelessWidget {
listener: (context, state) {
if (state.currentStore?.id != null) {
context.read<LatestStoreOperationsBloc>().add(
InitLastStoreOperationsEvent(state.currentStore!.id!),
InitLatestStoreOperationsEvent(state.currentStore!.id!),
);
}
},