feat: Add navigation and data entry page
This commit is contained in:
commit
d1b97dc621
68 changed files with 1769 additions and 0 deletions
44
lib/navigator/view.dart
Normal file
44
lib/navigator/view.dart
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
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],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue