copyWith method
GameState
copyWith({
- LevelConfig? level,
- int? levelIndex,
- List<
Cell> ? grid, - GameStatus? status,
- int? timeLeft,
- int? selectedIndex,
- int? score,
- int? addRowsUsed,
Implementation
GameState copyWith({
LevelConfig? level,
int? levelIndex,
List<Cell>? grid,
GameStatus? status,
int? timeLeft,
int? selectedIndex,
int? score,
int? addRowsUsed,
}) {
return GameState(
level: level ?? this.level,
levelIndex: levelIndex ?? this.levelIndex,
grid: grid ?? this.grid,
status: status ?? this.status,
timeLeft: timeLeft ?? this.timeLeft,
selectedIndex: selectedIndex,
score: score ?? this.score,
addRowsUsed: addRowsUsed ?? this.addRowsUsed,
);
}