fixed pages

This commit is contained in:
2026-09-04 08:15:25 +02:00
parent c80535eb97
commit a1167a2d03
14 changed files with 363 additions and 174 deletions
+19 -3
View File
@@ -81,6 +81,11 @@ class _ReschedulePageState extends State<ReschedulePage> {
return s[0].toUpperCase() + s.substring(1);
}
String _dateLabel(String ymd) {
final dt = DateFormat('yyyy-MM-dd').parse(ymd);
return DateFormat('dd/MM/yyyy').format(dt);
}
@override
Widget build(BuildContext context) {
const green = Color(0xFF10B981);
@@ -176,6 +181,7 @@ class _ReschedulePageState extends State<ReschedulePage> {
return _SlotCard(
slot: s,
weekday: _weekdayLabel(s.date),
dateLabel: _dateLabel(s.date),
onChoose: () => _confirm(s),
);
},
@@ -239,11 +245,13 @@ class _ReschedulePageState extends State<ReschedulePage> {
class _SlotCard extends StatelessWidget {
final AvailableSlot slot;
final String weekday;
final String dateLabel;
final VoidCallback onChoose;
const _SlotCard({
required this.slot,
required this.weekday,
required this.dateLabel,
required this.onChoose,
});
@@ -316,7 +324,7 @@ class _SlotCard extends StatelessWidget {
),
const SizedBox(height: 4),
Text(
'$weekday ${slot.date} • ${slot.time}',
'$weekday $dateLabel • ${slot.time}',
style: const TextStyle(
fontSize: 12,
color: Colors.black54,
@@ -325,10 +333,18 @@ class _SlotCard extends StatelessWidget {
),
const SizedBox(height: 2),
Text(
'Posti liberi: ${slot.freePlaces}/${slot.maxCapacity}',
isBooked
? 'Già prenotato'
: isFull
? 'Non disponibile'
: 'Disponibile',
style: TextStyle(
fontSize: 12,
color: isFull ? orange : Colors.black45,
color: isFull
? const Color(0xFF9AA0A6)
: isBooked
? orange
: green,
fontWeight: FontWeight.w700,
),
),