import 'package:flutter/material.dart'; import 'package:migrainetracker/data_entry/view.dart'; class NavigatorPage extends StatefulWidget { const NavigatorPage({Key? key}) : super(key: key); @override State createState() => _NavigatorPageState(); } class _NavigatorPageState extends State { int currentPageIndex = 0; @override Widget build(BuildContext context) { var pages = [ const DataEntryPage(), const Placeholder(), ]; return Scaffold( appBar: AppBar( title: const Text("Migraine Tracker"), ), bottomNavigationBar: NavigationBar( destinations: const [ NavigationDestination( icon: Icon(Icons.explore), label: 'Today', ), NavigationDestination( icon: Icon(Icons.commute), label: 'Stats', ), ], selectedIndex: currentPageIndex, onDestinationSelected: (int index) { setState(() { currentPageIndex = index; }); }, ), body: pages[currentPageIndex], ); } }