enum OrderService { AMBULANCE } extension SelectedOrderService on OrderService { int getIdOrderService() { switch (this) { case OrderService.AMBULANCE: return 4; break; } return 4; } OrderService getOrderServiceById(int id) { switch (id) { case 4: return OrderService.AMBULANCE; break; } return OrderService.AMBULANCE; } }