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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user