fixed pages
This commit is contained in:
@@ -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,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user