look ahead
This commit is contained in:
+33
-22
@@ -1,9 +1,11 @@
|
||||
/// Host scaffold: Home + Overview. Settings lives in the app-bar gear.
|
||||
/// Host scaffold: Home, Overview, Look ahead. Settings lives in the app-bar gear.
|
||||
library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../widgets/shell_tab_scope.dart';
|
||||
import 'home_screen.dart';
|
||||
import 'look_ahead_screen.dart';
|
||||
import 'overview_screen.dart';
|
||||
|
||||
class MainShell extends StatefulWidget {
|
||||
@@ -19,31 +21,40 @@ class _MainShellState extends State<MainShell> {
|
||||
static const _pages = [
|
||||
HomeScreen(),
|
||||
OverviewScreen(),
|
||||
LookAheadScreen(),
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: IndexedStack(
|
||||
index: _index,
|
||||
children: _pages,
|
||||
),
|
||||
bottomNavigationBar: NavigationBar(
|
||||
selectedIndex: _index,
|
||||
onDestinationSelected: (index) => setState(() => _index = index),
|
||||
labelBehavior: NavigationDestinationLabelBehavior.alwaysShow,
|
||||
destinations: const [
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.home_outlined),
|
||||
selectedIcon: Icon(Icons.home),
|
||||
label: 'Home',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.insights_outlined),
|
||||
selectedIcon: Icon(Icons.insights),
|
||||
label: 'Overview',
|
||||
),
|
||||
],
|
||||
return ShellTabScope(
|
||||
index: _index,
|
||||
child: Scaffold(
|
||||
body: IndexedStack(
|
||||
index: _index,
|
||||
children: _pages,
|
||||
),
|
||||
bottomNavigationBar: NavigationBar(
|
||||
selectedIndex: _index,
|
||||
onDestinationSelected: (index) => setState(() => _index = index),
|
||||
labelBehavior: NavigationDestinationLabelBehavior.alwaysShow,
|
||||
destinations: const [
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.home_outlined),
|
||||
selectedIcon: Icon(Icons.home),
|
||||
label: 'Home',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.insights_outlined),
|
||||
selectedIcon: Icon(Icons.insights),
|
||||
label: 'Overview',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.event_repeat_outlined),
|
||||
selectedIcon: Icon(Icons.event_repeat),
|
||||
label: 'Look ahead',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user