getStatusIcon method

IconData getStatusIcon(
  1. RoverStatus status
)

An appropriate battery icon representing the rover's current status.

Implementation

IconData getStatusIcon(RoverStatus status) => switch (status) {
  RoverStatus.DISCONNECTED => Icons.power_off,
  RoverStatus.POWER_OFF => Icons.power_off,
  RoverStatus.IDLE => Icons.pause_circle,
  RoverStatus.MANUAL => Icons.play_circle,
  RoverStatus.AUTONOMOUS => Icons.smart_toy,
  RoverStatus.RESTART => Icons.restart_alt,
  _ => throw ArgumentError("Unrecognized rover status: $status"),
};