Skip to content
Snippets Groups Projects
Select Git revision
  • bbf0abd5457d42678882384216af9e83c38549bc
  • master default protected
  • 21-add-onlongpress-with-popup-on-parameters
  • 23-center-vertically-buttons
  • 30-highlight-bin-when-selecting-disabled-item
  • 1.0.7 protected
  • 1.0.6 protected
  • 1.0.5 protected
  • 1.0.4 protected
  • 1.0.3 protected
  • 1.0.2 protected
  • 1.0.0 protected
  • 0.9.1 protected
  • 0.9.0 protected
  • 0.8.4 protected
  • 0.8.3 protected
  • 0.8.2 protected
  • 0.8.1 protected
  • 0.8.0 protected
  • 0.7.0 protected
  • 0.6.1 protected
  • 0.6.0 protected
  • 0.5.0 protected
  • 0.4.0 protected
  • 0.3.0 protected
25 results

application_theme_mode_state.dart

Blame
  • activity_page.dart 1.13 KiB
    import 'package:flutter/material.dart';
    import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
    
    import 'package:puissance4/common/ui/pages/game.dart';
    import 'package:puissance4/common/ui/pages/parameters.dart';
    
    class ActivityPageItem {
      final String code;
      final Icon icon;
      final Widget page;
    
      const ActivityPageItem({
        required this.code,
        required this.icon,
        required this.page,
      });
    }
    
    class ActivityPage {
      static const bool displayBottomNavBar = false;
    
      static const indexHome = 0;
      static const pageHome = ActivityPageItem(
        code: 'page_home',
        icon: Icon(UniconsLine.home),
        page: PageParameters(),
      );
    
      static const indexGame = 1;
      static const pageGame = ActivityPageItem(
        code: 'page_game',
        icon: Icon(UniconsLine.star),
        page: PageGame(),
      );
    
      static const Map<int, ActivityPageItem> items = {
        indexHome: pageHome,
        indexGame: pageGame,
      };
    
      static int defaultPageIndex = indexHome;
    
      static bool isIndexAllowed(int pageIndex) {
        return items.keys.contains(pageIndex);
      }
    
      static Widget getWidget(int pageIndex) {
        return items[pageIndex]?.page ?? pageHome.page;
      }
    }