Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save StanislawNagorski/d80530041d8d9e30e65566d97c355d6c to your computer and use it in GitHub Desktop.
Save StanislawNagorski/d80530041d8d9e30e65566d97c355d6c to your computer and use it in GitHub Desktop.
enums_on_duty_to_clean_presentation
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