dart_board_template_app_bar_sidenav 0.9.4+7 copy "dart_board_template_app_bar_sidenav: ^0.9.4+7" to clipboard
dart_board_template_app_bar_sidenav: ^0.9.4+7 copied to clipboard

A basic template example that works with the App Bar and SideNav and registered DartBoard routes using RouteView.

example/main.dart

import 'package:dart_board_core/dart_board_core.dart';
import 'package:dart_board_template_app_bar_sidenav/dart_board_template_app_bar_sidenav.dart';
import 'package:flutter/material.dart';

/// Minimal Dart Board example.
///
/// Provides a simple page, and a scaffold that would apply to all pages
/// and some basic navigation between 2 routes
///
/// For advanced usages, e.g. App Decorations, Multiple features, AB tests
/// check the example project in the root or at https://dart-board.io
void main() => runApp(DartBoard(
      initialPath: '/home',
      features: [
        AppBarSideNavTemplateFeature(title: "Example", route: '/home', config: [
          {
            'route': '/first',
            'label': 'First',
            'color': Colors.blue,
            'icon': Icons.car_rental
          },
          {
            'route': '/second',
            'label': 'Second',
            'color': Colors.red,
            'icon': Icons.ac_unit
          }
        ]),
        SimpleRouteFeature()
      ],
    ));

class SimpleRouteFeature extends DartBoardFeature {
  @override
  String get namespace => 'main_page';

  @override
  List<RouteDefinition> get routes => [
        NamedRouteDefinition(
            route: '/first',
            builder: (ctx, settings) => Container(
                  width: double.infinity,
                  child: Card(child: Text('Home Page')),
                )),
        NamedRouteDefinition(
            route: '/second',
            builder: (ctx, settings) => Container(
                  width: double.infinity,
                  child: Card(child: Text('Second Page')),
                )),
      ];
}
1
likes
140
pub points
0%
popularity

Publisher

verified publisherdart-board.io

A basic template example that works with the App Bar and SideNav and registered DartBoard routes using RouteView.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

dart_board_core, dart_board_locator, flutter, logging

More

Packages that depend on dart_board_template_app_bar_sidenav