getStatusColor method

Color getStatusColor(
  1. RoverStatus status
)

The color of the rover's status icon.

Implementation

Color getStatusColor(RoverStatus status) => switch(status) {
  RoverStatus.DISCONNECTED => Colors.black,
  RoverStatus.IDLE => Colors.yellow,
  RoverStatus.MANUAL => Colors.green,
  RoverStatus.AUTONOMOUS => Colors.blueGrey,
  RoverStatus.POWER_OFF => Colors.red,
  RoverStatus.RESTART => Colors.yellow,
  _ => throw ArgumentError("Unrecognized rover status: $status"),
};