Refactor provider and store models to use fromMap method; update associated stores handling in UI

This commit is contained in:
2026-04-17 11:36:15 +02:00
parent c1b6c9e7ac
commit 22a4f1dac4
9 changed files with 78 additions and 54 deletions

View File

@@ -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;

View File

@@ -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),