getColor method

Color getColor(
  1. GamepadBatteryLevel battery
)

Returns a color representing the gamepad's battery level.

Implementation

Color getColor(GamepadBatteryLevel battery) {
	switch (battery) {
		case GamepadBatteryLevel.low: return Colors.red;
		case GamepadBatteryLevel.medium: return Colors.orange;
		case GamepadBatteryLevel.full: return Colors.green;
		case GamepadBatteryLevel.unknown: return Colors.black;
	}
}