Last active
January 9, 2023 10:17
-
-
Save StanislawNagorski/d80530041d8d9e30e65566d97c355d6c to your computer and use it in GitHub Desktop.
enums_on_duty_to_clean_presentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Game { | |
tekken( | |
nameTranslationKey: SKeys.game_name_tekken, | |
gameSize: GameSize.large, | |
iconPath: AppImages.gameLogoTekken, | |
requiresPass: true, | |
), | |
pokemon_blue( | |
nameTranslationKey: SKeys.game_name_pokemon_blue, | |
gameSize: GameSize.large, | |
iconPath: AppImages.gameLogoPokemonBlue, | |
requiresPass: false, | |
), | |
witcher( | |
nameTranslationKey: SKeys.game_name_witcher, | |
gameSize: GameSize.xLarge, | |
iconPath: AppImages.gameLogoWitcher, | |
requiresPass: true, | |
), | |
snake( | |
nameTranslationKey: SKeys.game_name_snake, | |
gameSize: GameSize.small, | |
iconPath: AppImages.gameLogoSnake, | |
requiresPass: false, | |
); | |
const Game({ | |
required this.nameTranslationKey, | |
required this.gameSize, | |
required this.iconPath, | |
required this.requiresPass, | |
}); | |
final String nameTranslationKey; | |
final GameSize gameSize; | |
final String iconPath; | |
final bool requiresPass; | |
static List<Game> getGamesWithPass() => Game.values.where((game) => game.requiresPass).toList(); | |
static List<Game> getAllFreeGames() => Game.values.where((game) => !game.requiresPass).toList(); | |
} | |
enum GameSize { | |
small(nameTranslationKey: SKeys.size_small), | |
large(nameTranslationKey: SKeys.size_large), | |
xLarge( nameTranslationKey: SKeys.size_xlarge); | |
const GameSize({ | |
required this.nameTranslationKey, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment