aggiunta scelta business o privato

This commit is contained in:
2026-05-19 11:54:59 +02:00
parent 2bdba523ad
commit 4e03d52a5d
11 changed files with 173 additions and 38 deletions

View File

@@ -457,10 +457,11 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
);
}).toList(),
onChanged: (newStatus) {
if (newStatus != null)
if (newStatus != null) {
context.read<OperationFormCubit>().updateFields(
status: newStatus,
);
}
},
),
),
@@ -482,6 +483,38 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
icon: Icons.design_services,
themeColor: Colors.deepOrange,
children: [
Row(
children: [
ChoiceChip(
label: const Text('Privato (Domestico)'),
selected: !state.operation.isBusiness,
selectedColor: Colors.blue.withValues(alpha: 0.2),
checkmarkColor: Colors.blue.shade700,
onSelected: (selected) {
if (selected) {
context.read<OperationFormCubit>().updateFields(
isBusiness: false,
);
}
},
),
const SizedBox(width: 12),
ChoiceChip(
label: const Text('Business (P.IVA)'),
selected: state.operation.isBusiness,
selectedColor: Colors.orange.withValues(alpha: 0.2),
checkmarkColor: Colors.orange.shade700,
onSelected: (selected) {
if (selected) {
context.read<OperationFormCubit>().updateFields(
isBusiness: true,
);
}
},
),
],
),
const Divider(height: 32),
Wrap(
spacing: 8.0,
runSpacing: 8.0,
@@ -490,10 +523,11 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
label: Text(type),
selected: state.operation.type == type,
onSelected: (selected) {
if (selected)
if (selected) {
context.read<OperationFormCubit>().setTypeWithSmartDefault(
type,
);
}
},
);
}).toList(),