refinements

This commit is contained in:
2026-05-25 12:49:04 +02:00
parent aad9a991c2
commit 9b5d19b926
13 changed files with 609 additions and 529 deletions

View File

@@ -784,6 +784,7 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
children: [
Expanded(
child: DropdownButtonFormField<TicketType>(
isExpanded: true,
initialValue: ticket.ticketType,
decoration: const InputDecoration(
labelText: 'Tipo Lavorazione',
@@ -804,6 +805,7 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
const SizedBox(width: 16),
Expanded(
child: DropdownButtonFormField<TicketStatus>(
isExpanded: true,
initialValue: ticket.ticketStatus,
decoration: const InputDecoration(labelText: 'Stato Attuale'),
items: TicketStatus.values
@@ -1001,11 +1003,15 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
child: Icon(icon, color: themeColor),
),
const SizedBox(width: 12),
Text(
title,
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.bold,
color: themeColor,
Expanded(
child: Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.bold,
color: themeColor,
),
),
),
],

View File

@@ -133,29 +133,44 @@ class TicketList extends StatelessWidget {
horizontal: 16.0,
vertical: 8.0,
),
child: Row(
// ECCO LA MAGIA: Wrap invece di Row!
child: Wrap(
alignment: WrapAlignment.spaceBetween, // Sostituisce lo Spacer!
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 8.0, // Spazio orizzontale
runSpacing: 8.0, // Spazio verticale se va a capo
children: [
IconButton(
icon: const Icon(Icons.close),
onPressed: () =>
context.read<TicketListCubit>().clearSelection(),
),
Text(
'${state.selectedTickets.length} selezionati',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
const Spacer(),
// BLOCCO 1: Icona e Contatore
Row(
mainAxisSize: MainAxisSize
.min, // Fondamentale per non occupare tutto il Wrap
children: [
IconButton(
icon: const Icon(Icons.close),
onPressed: () =>
context.read<TicketListCubit>().clearSelection(),
),
Text(
'${state.selectedTickets.length} selezionati',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
],
),
// BLOCCO 2: I Bottoni (Un altro Wrap per farli andare a capo tra loro se serve!)
Wrap(
spacing: 8.0,
runSpacing: 8.0,
alignment: WrapAlignment.end,
children: [
FilledButton.icon(
onPressed: () => _setStatusClosed(context),
icon: const Icon(Icons.approval),
label: const Text('Riconsegna'),
),
const SizedBox(width: 8),
FilledButton.icon(
onPressed: () => _showShippingModal(context),
icon: const Icon(Icons.local_shipping),