Gauge constructor Null safety

Gauge(
  1. BitmapData bitmapData,
  2. [String direction = DIRECTION_LEFT]
)

Implementation

Gauge(this.bitmapData, [this.direction = DIRECTION_LEFT]) {
  var validDirection = false;
  validDirection = validDirection || direction == DIRECTION_UP;
  validDirection = validDirection || direction == DIRECTION_DOWN;
  validDirection = validDirection || direction == DIRECTION_LEFT;
  validDirection = validDirection || direction == DIRECTION_RIGHT;

  if (!validDirection) throw ArgumentError('Invalid Gauge direction!');
}