2026-05-07 16:28:01 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flux/features/tickets/models/ticket_model.dart';
|
|
|
|
|
|
|
|
|
|
extension TicketStatusVisuals on TicketStatus {
|
|
|
|
|
Color get color {
|
|
|
|
|
switch (this) {
|
|
|
|
|
case TicketStatus.open:
|
|
|
|
|
return Colors.blueGrey;
|
2026-05-14 12:07:05 +02:00
|
|
|
case TicketStatus.waitingForParts ||
|
|
|
|
|
TicketStatus.waitingForQuote ||
|
|
|
|
|
TicketStatus.waitingForCustomer:
|
2026-05-07 16:28:01 +02:00
|
|
|
return Colors.amber.shade700;
|
|
|
|
|
case TicketStatus.inProgress:
|
|
|
|
|
return Colors.blue;
|
|
|
|
|
case TicketStatus.waitingForShipping:
|
|
|
|
|
// Il tuo rosa storico!
|
|
|
|
|
return Colors.pinkAccent;
|
|
|
|
|
case TicketStatus.waitingForReturn:
|
|
|
|
|
return Colors.purpleAccent;
|
|
|
|
|
case TicketStatus.ready:
|
|
|
|
|
return Colors.green;
|
|
|
|
|
case TicketStatus.closed:
|
|
|
|
|
return Colors.grey.shade400;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IconData get icon {
|
|
|
|
|
switch (this) {
|
|
|
|
|
case TicketStatus.open:
|
|
|
|
|
return Icons.inbox;
|
2026-05-14 12:07:05 +02:00
|
|
|
case TicketStatus.waitingForParts ||
|
|
|
|
|
TicketStatus.waitingForQuote ||
|
|
|
|
|
TicketStatus.waitingForCustomer:
|
2026-05-07 16:28:01 +02:00
|
|
|
return Icons.hourglass_empty;
|
|
|
|
|
case TicketStatus.inProgress:
|
|
|
|
|
return Icons.build;
|
|
|
|
|
case TicketStatus.waitingForShipping:
|
|
|
|
|
return Icons.local_shipping_outlined;
|
|
|
|
|
case TicketStatus.waitingForReturn:
|
|
|
|
|
return Icons.undo;
|
|
|
|
|
case TicketStatus.ready:
|
|
|
|
|
return Icons.check_circle_outline;
|
|
|
|
|
case TicketStatus.closed:
|
|
|
|
|
return Icons.lock_outline;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|