fixed pages

This commit is contained in:
2026-08-22 08:26:27 +02:00
parent 64eade33f3
commit 770c89ca3f
4 changed files with 276 additions and 79 deletions
+131 -16
View File
@@ -92,23 +92,90 @@ class _OrdersDetailPageState extends State<OrdersDetailPage> {
itemCount: orders.length,
itemBuilder: (_, i) {
final o = orders[i];
return Card(
margin: const EdgeInsets.only(bottom: 12),
child: ListTile(
title: Text(
o.serviceName.isEmpty
? 'Ordine #${o.orderId}'
: o.serviceName,
style: const TextStyle(fontWeight: FontWeight.w800),
),
subtitle: Text(
'Ordine #${o.orderId} • ${o.tickets} lezioni\n'
'Da programmare: ${o.toSchedule} • Scadenza: ${_fmtDate(o.expireOn)}'
'${o.isExpired ? " (scaduto)" : ""}',
),
isThreeLine: true,
trailing: const Icon(Icons.chevron_right),
return Container(
margin: const EdgeInsets.only(bottom: 14),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(18),
boxShadow: const [
BoxShadow(
blurRadius: 18,
color: Color(0x12000000),
offset: Offset(0, 10),
),
],
),
child: InkWell(
borderRadius: BorderRadius.circular(18),
onTap: () => _openDetail(o),
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 14, 12, 14),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
o.serviceName.isEmpty
? 'Ordine #${o.orderId}'
: o.serviceName,
style: const TextStyle(
fontWeight: FontWeight.w900,
fontSize: 16,
),
),
const SizedBox(height: 6),
Text(
'Ordine #${o.orderId} • ${o.tickets} lezioni',
style: const TextStyle(
fontSize: 12,
color: Colors.black54,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 4),
Text(
'Da programmare: ${o.toSchedule}',
style: const TextStyle(
fontSize: 12,
color: Colors.black54,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 8),
// Riga riprogrammazioni + scadenza (chip)
Wrap(
spacing: 8,
runSpacing: 6,
children: [
_MiniChip(
icon: Icons.autorenew,
label:
'Riprog. ${o.reprogrammed}/${o.maxReschedule}',
color: const Color(0xFF10B981),
),
_MiniChip(
icon: Icons.event_busy,
label:
'Scad. ${_fmtDate(o.expireOn)}',
color: o.isExpired
? const Color(0xFFDC3545)
: const Color(0xFFF59E0B),
),
],
),
],
),
),
const SizedBox(width: 6),
const Icon(
Icons.chevron_right,
color: Colors.black38,
),
],
),
),
),
);
},
@@ -242,6 +309,15 @@ class _OrderDetailSheet extends StatelessWidget {
'${order.isExpired ? " (scaduto)" : ""}',
style: const TextStyle(fontSize: 12, color: Colors.black54),
),
const SizedBox(height: 4),
Text(
'Riprogrammazioni usate: ${order.reprogrammed} / ${order.maxReschedule}',
style: const TextStyle(
fontSize: 12,
color: Colors.black54,
fontWeight: FontWeight.w600,
),
),
const Divider(height: 24),
const Text(
@@ -335,3 +411,42 @@ class _OrderDetailSheet extends StatelessWidget {
);
}
}
class _MiniChip extends StatelessWidget {
final IconData icon;
final String label;
final Color color;
const _MiniChip({
required this.icon,
required this.label,
required this.color,
});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
decoration: BoxDecoration(
color: color.withValues(alpha: 0.12),
borderRadius: BorderRadius.circular(999),
border: Border.all(color: color.withValues(alpha: 0.5), width: 1),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, size: 14, color: color),
const SizedBox(width: 5),
Text(
label,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w800,
color: color,
),
),
],
),
);
}
}