findRootGame method
Fetches the root FlameGame
ancestor to the component.
Implementation
FlameGame? findRootGame() {
var game = findGame();
while (game?.parent != null) {
game = game!.parent!.findGame();
}
return game;
}
Fetches the root FlameGame
ancestor to the component.
FlameGame? findRootGame() {
var game = findGame();
while (game?.parent != null) {
game = game!.parent!.findGame();
}
return game;
}