Skip to content
Snippets Groups Projects
Select Git revision
  • 512b76b84729cbc2a348578dcb1f9c3a3a873965
  • master default protected
  • 100-upgrade-framework-and-dependencies
  • 65-improve-app-metadata
  • Release_1.8.0_80 protected
  • Release_1.7.2_79 protected
  • Release_1.7.1_78 protected
  • Release_1.7.0_77 protected
  • Release_1.6.0_76 protected
  • Release_1.5.0_75 protected
  • Release_1.4.0_74 protected
  • Release_1.3.2_73 protected
  • Release_1.3.1_72 protected
  • Release_1.3.0_71 protected
  • Release_1.2.1_70 protected
  • Release_1.2.0_69 protected
  • Release_1.1.3_68 protected
  • Release_1.1.2_67 protected
  • Release_1.1.1_66 protected
  • Release_1.1.0_65 protected
  • Release_1.0.63_64 protected
  • Release_1.0.62_63 protected
  • Release_1.0.61_62 protected
  • Release_1.0.60_61 protected
24 results

build_resources.sh

Blame
  • application_config.dart 6.10 KiB
    import 'package:flutter/material.dart';
    import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
    
    import 'package:snake/cubit/activity/activity_cubit.dart';
    
    import 'package:snake/ui/pages/game.dart';
    
    import 'package:snake/ui/parameters/parameter_painter_board_size.dart';
    import 'package:snake/ui/parameters/parameter_painter_difficulty_level.dart';
    
    class ApplicationConfig {
      // activity parameter: skin
      static const String parameterCodeSkin = 'global.skin';
      static const String skinValueColors = 'colors';
    
      // activity parameter: difficulty level
      static const String parameterCodeDifficultyLevel = 'difficultyLevel';
      static const String difficultyLevelValueEasy = 'easy';
      static const String difficultyLevelValueMedium = 'medium';
      static const String difficultyLevelValueHard = 'hard';
      static const String difficultyLevelValueNightmare = 'nightmare';
    
      // activity parameter: board size
      static const String parameterCodeBoardSize = 'boardSize';
      static const String boardSizeValueSmall = 'small';
      static const String boardSizeValueMedium = 'medium';
      static const String boardSizeValueLarge = 'large';
      static const String boardSizeValueExtraLarge = 'extra';
    
      // activity pages
      static const int activityPageIndexHome = 0;
      static const int activityPageIndexGame = 1;
    
      static final ApplicationConfigDefinition config = ApplicationConfigDefinition(
        appTitle: 'Snake',
        activitySettings: [
          // skin
          ApplicationSettingsParameter(
            code: parameterCodeSkin,
            values: [
              ApplicationSettingsParameterItemValue(
                value: skinValueColors,
                isDefault: true,
              ),
            ],
          ),
    
          // difficulty level
          ApplicationSettingsParameter(
            code: parameterCodeDifficultyLevel,
            values: [
              ApplicationSettingsParameterItemValue(
                value: difficultyLevelValueEasy,
                color: Colors.green,
              ),
              ApplicationSettingsParameterItemValue(
                value: difficultyLevelValueMedium,
                color: Colors.orange,
                isDefault: true,
              ),
              ApplicationSettingsParameterItemValue(
                value: difficultyLevelValueHard,
                color: Colors.red,
              ),
              ApplicationSettingsParameterItemValue(
                value: difficultyLevelValueNightmare,
                color: Colors.purple,
              ),
            ],
            customPainter: (context, value) => ParameterPainterDifficultyLevel(