LevelPathNode constructor

LevelPathNode({
  1. required int level,
  2. required LevelState state,
  3. int starsEarned = 0,
  4. bool isCurrent = false,
})

Implementation

LevelPathNode({
  required this.level,
  required this.state,
  this.starsEarned = 0,
  this.isCurrent = false,
}) {
  if (level < 1) {
    throw ArgumentError.value(level, 'level', 'must be at least 1');
  }
  if (starsEarned < 0 || starsEarned > 3) {
    throw ArgumentError.value(
      starsEarned,
      'starsEarned',
      'must be between 0 and 3',
    );
  }
}