44 lines
1.1 KiB
Dart
44 lines
1.1 KiB
Dart
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<NavigatorPage> createState() => _NavigatorPageState();
|
|
}
|
|
|
|
class _NavigatorPageState extends State<NavigatorPage> {
|
|
int currentPageIndex = 0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text("Migraine Tracker"),
|
|
),
|
|
bottomNavigationBar: NavigationBar(
|
|
destinations: const <Widget>[
|
|
NavigationDestination(
|
|
icon: Icon(Icons.explore),
|
|
label: 'Today',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.commute),
|
|
label: 'Stats',
|
|
),
|
|
],
|
|
selectedIndex: currentPageIndex,
|
|
onDestinationSelected: (int index) {
|
|
setState(() {
|
|
currentPageIndex = index;
|
|
});
|
|
},
|
|
),
|
|
body: <Widget>[
|
|
const DataEntryPage(),
|
|
const Placeholder(),
|
|
][currentPageIndex],
|
|
);
|
|
}
|
|
}
|