Navaron Bracke

convert torch state to enhanced enum

1 -/// The state of torch. 1 +/// The state of the flashlight.
2 enum TorchState { 2 enum TorchState {
3 - /// Torch is off.  
4 - off, 3 + /// The flashlight is off.
  4 + off(0),
5 5
6 - /// Torch is on.  
7 - on, 6 + /// The flashlight is on.
  7 + on(1);
  8 +
  9 + const TorchState(this.rawValue);
  10 +
  11 + /// The raw value for the torch state.
  12 + final int rawValue;
8 } 13 }