providers-in-store (#4)

Reviewed-on: http://catelliub.zapto.org:3000/brontomark/flux/pulls/4
Co-authored-by: mark-cachy <marco@catelli.it>
Co-committed-by: mark-cachy <marco@catelli.it>
This commit is contained in:
2026-04-17 15:37:14 +02:00
committed by brontomark
parent c1b6c9e7ac
commit 667bbf6404
14 changed files with 688 additions and 335 deletions

View File

@@ -71,9 +71,7 @@ class SessionBloc extends Bloc<SessionEvent, SessionState> {
);
return;
}
final availableStores = stores
.map((s) => StoreModel.fromJson(s))
.toList();
final availableStores = stores.map((s) => StoreModel.fromMap(s)).toList();
// 3. Tutto ok, gestiamo le SharedPreferences per il negozio
final prefs = GetIt.I.get<SharedPreferences>();
@@ -84,7 +82,7 @@ class SessionBloc extends Bloc<SessionEvent, SessionState> {
lastStoreId = stores.first['id'];
await prefs.setString('last_store_id', lastStoreId!);
}
final selectedStore = StoreModel.fromJson(
final selectedStore = StoreModel.fromMap(
stores.firstWhere((s) => s['id'] == lastStoreId),
);
emit(