Skip to content
Snippets Groups Projects
Select Git revision
  • ff755f2ce78457881908d5a3afce728a47315469
  • master default protected
  • 21-add-onlongpress-with-popup-on-parameters
  • 23-center-vertically-buttons
  • 30-highlight-bin-when-selecting-disabled-item
  • 1.0.8 protected
  • 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
25 results

pubspec.yaml

Blame
  • activity_page.dart 1.38 KiB
    import 'package:flutter/material.dart';
    import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
    
    import 'package:midisynth/common/ui/pages/editor.dart';
    import 'package:midisynth/common/ui/pages/home.dart';
    import 'package:midisynth/common/ui/pages/player.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 = true;
    
      static const indexHome = 0;
      static const pageHome = ActivityPageItem(
        code: 'page_home',
        icon: Icon(UniconsLine.home),
        page: PageHome(),
      );
    
      static const indexEditor = 1;
      static const pageEditor = ActivityPageItem(
        code: 'page_editor',
        icon: Icon(UniconsLine.edit),
        page: PageEditor(),
      );
    
      static const indexPlayer = 2;
      static const pagePlayer = ActivityPageItem(
        code: 'page_player',
        icon: Icon(UniconsLine.play),
        page: PagePlayer(),
      );
    
      static const Map<int, ActivityPageItem> items = {
        indexHome: pageHome,
        indexEditor: pageEditor,
        indexPlayer: pagePlayer,
      };
    
      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;
      }
    }