Refactor provider and store models to use fromMap method; update associated stores handling in UI
This commit is contained in:
@@ -29,6 +29,9 @@ class _ProviderFormSheetState extends State<ProviderFormSheet> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
final p = widget.initialProvider;
|
||||
for (final store in p?.associatedStores ?? []) {
|
||||
_tempSelectedStoreIds.add(store.id!);
|
||||
}
|
||||
_nameController = TextEditingController(text: p?.nome ?? '');
|
||||
_telefoniaFissa = p?.telefoniaFissa ?? false;
|
||||
_telefoniaMobile = p?.telefoniaMobile ?? false;
|
||||
|
||||
@@ -126,7 +126,7 @@ class _ProvidersMasterDataScreenState extends State<ProvidersMasterDataScreen> {
|
||||
// Un piccolo testo che indica il numero di store associati
|
||||
// Nota: Dovrai assicurarti che il Cubit carichi queste info
|
||||
return Text(
|
||||
"Disponibile in ${provider.storesCount} negozi",
|
||||
"Disponibile in ${provider.associatedStores.length} negozi",
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: Colors.indigo.withValues(alpha: 0.7),
|
||||
|
||||
Reference in New Issue
Block a user