feat-ultimi_servizi-contratti_in_scadenza #12
@@ -45,14 +45,14 @@ class CompanyModel extends Equatable {
|
||||
final String userId; // Nel DB è user_id (chiave esterna su auth.users)
|
||||
|
||||
// Dati Anagrafici e Fatturazione
|
||||
final String ragioneSociale;
|
||||
final String indirizzo;
|
||||
final String cap;
|
||||
final String citta;
|
||||
final String provincia;
|
||||
final String partitaIva;
|
||||
final String codiceFiscale;
|
||||
final String codiceUnivoco;
|
||||
final String name;
|
||||
final String address;
|
||||
final String zipCode;
|
||||
final String city;
|
||||
final String province;
|
||||
final String vatId;
|
||||
final String fiscalCode;
|
||||
final String sdi;
|
||||
final String companyLogo;
|
||||
|
||||
// Stato Pagamenti (Ibride: manuale + Stripe)
|
||||
@@ -70,14 +70,14 @@ class CompanyModel extends Equatable {
|
||||
this.id,
|
||||
this.createdAt,
|
||||
required this.userId,
|
||||
required this.ragioneSociale,
|
||||
required this.indirizzo,
|
||||
required this.cap,
|
||||
required this.citta,
|
||||
required this.provincia,
|
||||
required this.partitaIva,
|
||||
required this.codiceFiscale,
|
||||
required this.codiceUnivoco,
|
||||
required this.name,
|
||||
required this.address,
|
||||
required this.zipCode,
|
||||
required this.city,
|
||||
required this.province,
|
||||
required this.vatId,
|
||||
required this.fiscalCode,
|
||||
required this.sdi,
|
||||
this.companyLogo = '',
|
||||
this.isPaid = false,
|
||||
this.paymentExpiration,
|
||||
@@ -92,14 +92,14 @@ class CompanyModel extends Equatable {
|
||||
String? id,
|
||||
DateTime? createdAt,
|
||||
String? userId,
|
||||
String? ragioneSociale,
|
||||
String? indirizzo,
|
||||
String? cap,
|
||||
String? citta,
|
||||
String? provincia,
|
||||
String? partitaIva,
|
||||
String? codiceFiscale,
|
||||
String? codiceUnivoco,
|
||||
String? name,
|
||||
String? address,
|
||||
String? zipCode,
|
||||
String? city,
|
||||
String? province,
|
||||
String? vatId,
|
||||
String? fiscalCode,
|
||||
String? sdi,
|
||||
String? companyLogo,
|
||||
bool? isPaid,
|
||||
DateTime? paymentExpiration,
|
||||
@@ -113,14 +113,14 @@ class CompanyModel extends Equatable {
|
||||
id: id ?? this.id,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
userId: userId ?? this.userId,
|
||||
ragioneSociale: ragioneSociale ?? this.ragioneSociale,
|
||||
indirizzo: indirizzo ?? this.indirizzo,
|
||||
cap: cap ?? this.cap,
|
||||
citta: citta ?? this.citta,
|
||||
provincia: provincia ?? this.provincia,
|
||||
partitaIva: partitaIva ?? this.partitaIva,
|
||||
codiceFiscale: codiceFiscale ?? this.codiceFiscale,
|
||||
codiceUnivoco: codiceUnivoco ?? this.codiceUnivoco,
|
||||
name: name ?? this.name,
|
||||
address: address ?? this.address,
|
||||
zipCode: zipCode ?? this.zipCode,
|
||||
city: city ?? this.city,
|
||||
province: province ?? this.province,
|
||||
vatId: vatId ?? this.vatId,
|
||||
fiscalCode: fiscalCode ?? this.fiscalCode,
|
||||
sdi: sdi ?? this.sdi,
|
||||
companyLogo: companyLogo ?? this.companyLogo,
|
||||
isPaid: isPaid ?? this.isPaid,
|
||||
paymentExpiration: paymentExpiration ?? this.paymentExpiration,
|
||||
@@ -137,14 +137,14 @@ class CompanyModel extends Equatable {
|
||||
id: null,
|
||||
createdAt: null,
|
||||
userId: '',
|
||||
ragioneSociale: '',
|
||||
indirizzo: '',
|
||||
cap: '',
|
||||
citta: '',
|
||||
provincia: '',
|
||||
partitaIva: '',
|
||||
codiceFiscale: '',
|
||||
codiceUnivoco: '',
|
||||
name: '',
|
||||
address: '',
|
||||
zipCode: '',
|
||||
city: '',
|
||||
province: '',
|
||||
vatId: '',
|
||||
fiscalCode: '',
|
||||
sdi: '',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -155,14 +155,14 @@ class CompanyModel extends Equatable {
|
||||
? DateTime.tryParse(map['created_at'])
|
||||
: null,
|
||||
userId: map['user_id'] ?? '',
|
||||
ragioneSociale: map['ragione_sociale'] ?? '',
|
||||
indirizzo: map['indirizzo'] ?? '',
|
||||
cap: map['cap'] ?? '',
|
||||
citta: map['citta'] ?? '',
|
||||
provincia: map['provincia'] ?? '',
|
||||
partitaIva: map['partita_iva'] ?? '',
|
||||
codiceFiscale: map['codice_fiscale'] ?? '',
|
||||
codiceUnivoco: map['codice_univoco'] ?? '',
|
||||
name: map['name'] ?? '',
|
||||
address: map['address'] ?? '',
|
||||
zipCode: map['zip_code'] ?? '',
|
||||
city: map['city'] ?? '',
|
||||
province: map['province'] ?? '',
|
||||
vatId: map['vat_id'] ?? '',
|
||||
fiscalCode: map['fiscal_code'] ?? '',
|
||||
sdi: map['sdi'] ?? '',
|
||||
companyLogo: map['company_logo'] ?? '',
|
||||
isPaid: map['is_paid'] ?? false,
|
||||
paymentExpiration: map['payment_expiration'] != null
|
||||
@@ -185,14 +185,14 @@ class CompanyModel extends Equatable {
|
||||
if (id != null) 'id': id,
|
||||
// created_at è gestito dal DB di default, di solito non si passa nell'insert
|
||||
'user_id': userId,
|
||||
'ragione_sociale': ragioneSociale,
|
||||
'indirizzo': indirizzo,
|
||||
'cap': cap,
|
||||
'citta': citta,
|
||||
'provincia': provincia,
|
||||
'partita_iva': partitaIva,
|
||||
'codice_fiscale': codiceFiscale,
|
||||
'codice_univoco': codiceUnivoco,
|
||||
'name': name,
|
||||
'address': address,
|
||||
'zip_code': zipCode,
|
||||
'city': city,
|
||||
'province': province,
|
||||
'vat_id': vatId,
|
||||
'fiscal_code': fiscalCode,
|
||||
'sdi': sdi,
|
||||
'company_logo': companyLogo,
|
||||
'is_paid': isPaid,
|
||||
if (paymentExpiration != null)
|
||||
@@ -213,14 +213,14 @@ class CompanyModel extends Equatable {
|
||||
id,
|
||||
createdAt,
|
||||
userId,
|
||||
ragioneSociale,
|
||||
indirizzo,
|
||||
cap,
|
||||
citta,
|
||||
provincia,
|
||||
partitaIva,
|
||||
codiceFiscale,
|
||||
codiceUnivoco,
|
||||
name,
|
||||
address,
|
||||
zipCode,
|
||||
city,
|
||||
province,
|
||||
vatId,
|
||||
fiscalCode,
|
||||
sdi,
|
||||
companyLogo,
|
||||
isPaid,
|
||||
paymentExpiration,
|
||||
|
||||
@@ -50,14 +50,14 @@ class _CreateCompanyScreenState extends State<CreateCompanyScreen> {
|
||||
|
||||
final company = CompanyModel(
|
||||
userId: userId,
|
||||
ragioneSociale: _ragioneSocialeController.text.trim(),
|
||||
indirizzo: _indirizzoController.text.trim(),
|
||||
cap: _capController.text.trim(),
|
||||
citta: _cittaController.text.trim(),
|
||||
provincia: _provinciaController.text.trim(),
|
||||
partitaIva: _pIvaController.text.trim(),
|
||||
codiceFiscale: _cfController.text.trim(),
|
||||
codiceUnivoco: _univocoController.text.trim().toUpperCase(),
|
||||
name: _ragioneSocialeController.text.trim(),
|
||||
address: _indirizzoController.text.trim(),
|
||||
zipCode: _capController.text.trim(),
|
||||
city: _cittaController.text.trim(),
|
||||
province: _provinciaController.text.trim(),
|
||||
vatId: _pIvaController.text.trim(),
|
||||
fiscalCode: _cfController.text.trim(),
|
||||
sdi: _univocoController.text.trim().toUpperCase(),
|
||||
// Gli altri campi hanno i default nel modello
|
||||
);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ class HomeScreen extends StatelessWidget {
|
||||
Icon(Icons.storefront, size: 16, color: context.primary),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
currentStore?.nome ?? context.l10n.homeNoStoreFound,
|
||||
currentStore?.name ?? context.l10n.homeNoStoreFound,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: context.primary,
|
||||
@@ -352,7 +352,7 @@ class HomeScreen extends StatelessWidget {
|
||||
: theme.iconTheme.color,
|
||||
),
|
||||
title: Text(
|
||||
store.nome,
|
||||
store.name,
|
||||
style: TextStyle(
|
||||
fontWeight: isSelected
|
||||
? FontWeight.bold
|
||||
|
||||
@@ -172,7 +172,7 @@ class _ProviderFormSheetState extends State<ProviderFormSheet> {
|
||||
store.id,
|
||||
);
|
||||
return CheckboxListTile(
|
||||
title: Text(store.nome),
|
||||
title: Text(store.name),
|
||||
value: isAssociated,
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
|
||||
@@ -126,7 +126,7 @@ class _StaffScreenState extends State<StaffScreen> {
|
||||
initialValue: _selectedStoreId,
|
||||
decoration: const InputDecoration(labelText: "Filtra per Negozio"),
|
||||
items: state.stores
|
||||
.map((s) => DropdownMenuItem(value: s.id, child: Text(s.nome)))
|
||||
.map((s) => DropdownMenuItem(value: s.id, child: Text(s.name)))
|
||||
.toList(),
|
||||
onChanged: (id) {
|
||||
setState(() => _selectedStoreId = id);
|
||||
@@ -355,7 +355,7 @@ class _StaffScreenState extends State<StaffScreen> {
|
||||
store.id,
|
||||
);
|
||||
return FilterChip(
|
||||
label: Text(store.nome),
|
||||
label: Text(store.name),
|
||||
selected: isSelected,
|
||||
onSelected: (selected) {
|
||||
setModalState(() {
|
||||
|
||||
@@ -4,30 +4,30 @@ import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
|
||||
|
||||
class StoreModel extends Equatable {
|
||||
final String? id;
|
||||
final String nome;
|
||||
final String name;
|
||||
final String companyId;
|
||||
final bool isActive;
|
||||
final bool isPaid;
|
||||
final DateTime? paymentExpiration;
|
||||
final String indirizzo;
|
||||
final String cap;
|
||||
final String comune;
|
||||
final String provincia;
|
||||
final String address;
|
||||
final String zipCode;
|
||||
final String city;
|
||||
final String province;
|
||||
final List<ProviderModel> associatedProviders; // Provider associati
|
||||
final List<StaffMemberModel>
|
||||
associatedStaffMembers; // Membri dello staff associati
|
||||
|
||||
const StoreModel({
|
||||
this.id,
|
||||
required this.nome,
|
||||
required this.name,
|
||||
required this.companyId,
|
||||
this.isActive = true,
|
||||
this.isPaid = false,
|
||||
this.paymentExpiration,
|
||||
required this.indirizzo,
|
||||
required this.cap,
|
||||
required this.comune,
|
||||
required this.provincia,
|
||||
required this.address,
|
||||
required this.zipCode,
|
||||
required this.city,
|
||||
required this.province,
|
||||
this.associatedProviders = const [],
|
||||
this.associatedStaffMembers = const [],
|
||||
});
|
||||
@@ -36,15 +36,15 @@ class StoreModel extends Equatable {
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
nome,
|
||||
name,
|
||||
companyId,
|
||||
isActive,
|
||||
isPaid,
|
||||
paymentExpiration,
|
||||
indirizzo,
|
||||
cap,
|
||||
comune,
|
||||
provincia,
|
||||
address,
|
||||
zipCode,
|
||||
city,
|
||||
province,
|
||||
associatedProviders,
|
||||
associatedStaffMembers,
|
||||
];
|
||||
@@ -52,29 +52,29 @@ class StoreModel extends Equatable {
|
||||
// Il mitico copyWith per creare nuove istanze modificando solo ciò che serve
|
||||
StoreModel copyWith({
|
||||
String? id,
|
||||
String? nome,
|
||||
String? name,
|
||||
String? companyId,
|
||||
bool? isActive,
|
||||
bool? isPaid,
|
||||
DateTime? paymentExpiration,
|
||||
String? indirizzo,
|
||||
String? cap,
|
||||
String? comune,
|
||||
String? provincia,
|
||||
String? address,
|
||||
String? zipCode,
|
||||
String? city,
|
||||
String? province,
|
||||
List<ProviderModel>? associatedProviders,
|
||||
List<StaffMemberModel>? associatedStaffMembers,
|
||||
}) {
|
||||
return StoreModel(
|
||||
id: id ?? this.id,
|
||||
nome: nome ?? this.nome,
|
||||
name: name ?? this.name,
|
||||
companyId: companyId ?? this.companyId,
|
||||
isActive: isActive ?? this.isActive,
|
||||
isPaid: isPaid ?? this.isPaid,
|
||||
paymentExpiration: paymentExpiration ?? this.paymentExpiration,
|
||||
indirizzo: indirizzo ?? this.indirizzo,
|
||||
cap: cap ?? this.cap,
|
||||
comune: comune ?? this.comune,
|
||||
provincia: provincia ?? this.provincia,
|
||||
address: address ?? this.address,
|
||||
zipCode: zipCode ?? this.zipCode,
|
||||
city: city ?? this.city,
|
||||
province: province ?? this.province,
|
||||
associatedProviders: associatedProviders ?? this.associatedProviders,
|
||||
associatedStaffMembers:
|
||||
associatedStaffMembers ?? this.associatedStaffMembers,
|
||||
@@ -83,12 +83,12 @@ class StoreModel extends Equatable {
|
||||
|
||||
factory StoreModel.empty() {
|
||||
return const StoreModel(
|
||||
nome: '',
|
||||
name: '',
|
||||
companyId: '',
|
||||
indirizzo: '',
|
||||
cap: '',
|
||||
comune: '',
|
||||
provincia: '',
|
||||
address: '',
|
||||
zipCode: '',
|
||||
city: '',
|
||||
province: '',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -118,17 +118,17 @@ class StoreModel extends Equatable {
|
||||
}
|
||||
return StoreModel(
|
||||
id: map['id'] as String,
|
||||
nome: map['nome'],
|
||||
name: map['name'],
|
||||
companyId: map['company_id'] as String,
|
||||
isActive: map['is_active'] ?? true,
|
||||
isPaid: map['is_paid'] ?? false,
|
||||
paymentExpiration: map['payment_expiration'] != null
|
||||
? DateTime.parse(map['payment_expiration'])
|
||||
: null,
|
||||
indirizzo: map['indirizzo'],
|
||||
cap: map['cap'],
|
||||
comune: map['comune'],
|
||||
provincia: map['provincia'],
|
||||
address: map['address'],
|
||||
zipCode: map['zip_code'],
|
||||
city: map['city'],
|
||||
province: map['province'],
|
||||
associatedProviders: providers,
|
||||
associatedStaffMembers: staffMembers,
|
||||
);
|
||||
@@ -137,16 +137,16 @@ class StoreModel extends Equatable {
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
if (id != null) 'id': id,
|
||||
'nome': nome,
|
||||
'name': name,
|
||||
'company_id': companyId,
|
||||
'is_active': isActive,
|
||||
'is_paid': isPaid,
|
||||
if (paymentExpiration != null)
|
||||
'payment_expiration': paymentExpiration!.toIso8601String(),
|
||||
'indirizzo': indirizzo,
|
||||
'cap': cap,
|
||||
'comune': comune,
|
||||
'provincia': provincia,
|
||||
'address': address,
|
||||
'zip_code': zipCode,
|
||||
'city': city,
|
||||
'province': province,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,14 +37,14 @@ class _CreateStoreScreenState extends State<CreateStoreScreen> {
|
||||
final company = context.read<SessionCubit>().state.company;
|
||||
if (company != null) {
|
||||
setState(() {
|
||||
_indirizzoController.text = company.indirizzo;
|
||||
_capController.text = company.cap;
|
||||
_indirizzoController.text = company.address;
|
||||
_capController.text = company.zipCode;
|
||||
_comuneController.text =
|
||||
company.citta; // Nel DB company è 'citta', store è 'comune'
|
||||
_provinciaController.text = company.provincia;
|
||||
company.city; // Nel DB company è 'citta', store è 'comune'
|
||||
_provinciaController.text = company.province;
|
||||
// Suggeriamo anche un nome se vuoto
|
||||
if (_nomeController.text.isEmpty) {
|
||||
_nomeController.text = '${company.ragioneSociale} - Sede';
|
||||
_nomeController.text = '${company.name} - Sede';
|
||||
}
|
||||
});
|
||||
|
||||
@@ -68,12 +68,12 @@ class _CreateStoreScreenState extends State<CreateStoreScreen> {
|
||||
}
|
||||
|
||||
final store = StoreModel(
|
||||
nome: _nomeController.text.trim(),
|
||||
name: _nomeController.text.trim(),
|
||||
companyId: company.id!,
|
||||
indirizzo: _indirizzoController.text.trim(),
|
||||
cap: _capController.text.trim(),
|
||||
comune: _comuneController.text.trim(),
|
||||
provincia: _provinciaController.text.trim().toUpperCase(),
|
||||
address: _indirizzoController.text.trim(),
|
||||
zipCode: _capController.text.trim(),
|
||||
city: _comuneController.text.trim(),
|
||||
province: _provinciaController.text.trim().toUpperCase(),
|
||||
);
|
||||
|
||||
context.read<StoreCubit>().createStore(store);
|
||||
|
||||
@@ -53,11 +53,11 @@ class _StoreCardState extends State<StoreCard> {
|
||||
color: widget.store.isActive ? context.accent : Colors.grey,
|
||||
),
|
||||
title: Text(
|
||||
widget.store.nome,
|
||||
widget.store.name,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
subtitle: Text(
|
||||
"${widget.store.comune} (${widget.store.provincia}) - ${widget.store.indirizzo}",
|
||||
"${widget.store.city} (${widget.store.province}) - ${widget.store.address}",
|
||||
),
|
||||
trailing: Switch(
|
||||
value: widget.store.isActive,
|
||||
@@ -129,7 +129,7 @@ class _StoreCardState extends State<StoreCard> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
"Personale di ${store.nome}",
|
||||
"Personale di ${store.name}",
|
||||
style: context.titleLarge,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
@@ -184,7 +184,7 @@ class _StoreCardState extends State<StoreCard> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text("Providers di ${store.nome}", style: context.titleLarge),
|
||||
Text("Providers di ${store.name}", style: context.titleLarge),
|
||||
const SizedBox(height: 16),
|
||||
...state.allProviders.map((provider) {
|
||||
final isAssociated = _tempAssociatedProviders.any(
|
||||
|
||||
@@ -24,11 +24,11 @@ class _StoreFormState extends State<StoreForm> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.store != null) {
|
||||
nomeController.text = widget.store!.nome;
|
||||
indirizzoController.text = widget.store!.indirizzo;
|
||||
capController.text = widget.store!.cap;
|
||||
comuneController.text = widget.store!.comune;
|
||||
provinciaController.text = widget.store!.provincia;
|
||||
nomeController.text = widget.store!.name;
|
||||
indirizzoController.text = widget.store!.address;
|
||||
capController.text = widget.store!.zipCode;
|
||||
comuneController.text = widget.store!.city;
|
||||
provinciaController.text = widget.store!.province;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,11 +124,11 @@ class _StoreFormState extends State<StoreForm> {
|
||||
id: widget
|
||||
.store
|
||||
?.id, // Se nullo, Supabase ne crea uno nuovo
|
||||
nome: nomeController.text,
|
||||
indirizzo: indirizzoController.text,
|
||||
cap: capController.text,
|
||||
comune: comuneController.text,
|
||||
provincia: provinciaController.text,
|
||||
name: nomeController.text,
|
||||
address: indirizzoController.text,
|
||||
zipCode: capController.text,
|
||||
city: comuneController.text,
|
||||
province: provinciaController.text,
|
||||
companyId: context
|
||||
.read<SessionCubit>()
|
||||
.state
|
||||
|
||||
@@ -25,7 +25,7 @@ class OnboardingCubit extends Cubit<OnboardingState> {
|
||||
Future<void> saveCompany(String companyName) async {
|
||||
emit(state.copyWith(isLoading: true));
|
||||
final company = CompanyModel.empty().copyWith(
|
||||
ragioneSociale: companyName,
|
||||
name: companyName,
|
||||
userId: GetIt.I<SupabaseClient>().auth.currentUser!.id,
|
||||
subscriptionTier: SubscriptionTier.pro,
|
||||
subscriptionStatus: SubscriptionStatus.trialing,
|
||||
|
||||
@@ -135,12 +135,12 @@ class _StoreOnboardingFormState extends State<StoreOnboardingForm> {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
// MIRACOLO DELLA FACTORY EMPTY!
|
||||
final newStore = StoreModel.empty().copyWith(
|
||||
nome: _nameCtrl.text.trim(),
|
||||
indirizzo: _addressCtrl.text.trim(),
|
||||
comune: _cityCtrl.text.trim(),
|
||||
cap: _zipCodeCtrl.text.trim(),
|
||||
name: _nameCtrl.text.trim(),
|
||||
address: _addressCtrl.text.trim(),
|
||||
city: _cityCtrl.text.trim(),
|
||||
zipCode: _zipCodeCtrl.text.trim(),
|
||||
// Formattiamo in maiuscolo qui, al momento del salvataggio!
|
||||
provincia: _provinceCtrl.text.trim().toUpperCase(),
|
||||
province: _provinceCtrl.text.trim().toUpperCase(),
|
||||
);
|
||||
context.read<OnboardingCubit>().saveStore(newStore);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class OperationsRepository {
|
||||
staff_member(name),
|
||||
provider(name),
|
||||
model(name_with_brand),
|
||||
attachments(*)
|
||||
attachment(*)
|
||||
''')
|
||||
.eq('id', id)
|
||||
.single();
|
||||
@@ -52,7 +52,7 @@ class OperationsRepository {
|
||||
provider(name),
|
||||
model(name_with_brand),
|
||||
staff_member(name),
|
||||
attachments(*)
|
||||
attachment(*)
|
||||
''')
|
||||
.eq('company_id', companyId);
|
||||
|
||||
@@ -122,7 +122,7 @@ class OperationsRepository {
|
||||
provider(name),
|
||||
model(name_with_brand),
|
||||
customer(name),
|
||||
attachments(*)
|
||||
attachment(*)
|
||||
''')
|
||||
.eq('id', newId)
|
||||
.single();
|
||||
|
||||
@@ -1021,12 +1021,12 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
context.read<OperationsCubit>().updateOperationFields(
|
||||
modelId:
|
||||
'id_del_modello_$index', // deviceModel.id
|
||||
// Assicurati di avere questo campo in _updateOperationFields nel Cubit!
|
||||
// modelDisplayName: deviceModel.nameWithBrand,
|
||||
);
|
||||
context
|
||||
.read<OperationsCubit>()
|
||||
.updateOperationFields(
|
||||
modelId: deviceModel.id,
|
||||
modelDisplayName: deviceModel.nameWithBrand,
|
||||
);
|
||||
Navigator.pop(modalContext);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user