Files
ingtrakapp/lib/screens/main_shell.dart
T
2026-09-06 21:58:59 +02:00

50 lines
1.1 KiB
Dart

/// Host scaffold: Home + Overview. Settings lives in the app-bar gear.
library;
import 'package:flutter/material.dart';
import 'home_screen.dart';
import 'overview_screen.dart';
class MainShell extends StatefulWidget {
const MainShell({super.key});
@override
State<MainShell> createState() => _MainShellState();
}
class _MainShellState extends State<MainShell> {
int _index = 0;
static const _pages = [
HomeScreen(),
OverviewScreen(),
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: IndexedStack(
index: _index,
children: _pages,
),
bottomNavigationBar: NavigationBar(
selectedIndex: _index,
onDestinationSelected: (index) => setState(() => _index = index),
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',
),
],
),
);
}
}