71 lines
1.8 KiB
Dart
71 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:pblv/doctor_page.dart';
|
|
import 'package:pblv/history_page.dart';
|
|
import 'package:pblv/home_page_content.dart';
|
|
|
|
void main() {
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
title: 'MediHM',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Color(0xFF030070)),
|
|
),
|
|
home: const MyHomepage(title: 'MediHM'),
|
|
);
|
|
}
|
|
}
|
|
|
|
class MyHomepage extends StatefulWidget {
|
|
final String title;
|
|
|
|
const MyHomepage({super.key, required this.title});
|
|
|
|
@override
|
|
State<MyHomepage> createState() => _MyHomepageState();
|
|
}
|
|
|
|
class _MyHomepageState extends State<MyHomepage> {
|
|
int _selectedIndex = 0;
|
|
|
|
final content = <Widget>[HomePageContent(), HistoryPage(), DoctorPage()];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text(widget.title),
|
|
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
|
|
actions: [IconButton(onPressed: () {}, icon: Icon(Icons.settings))],
|
|
),
|
|
body: content[_selectedIndex],
|
|
bottomNavigationBar: NavigationBar(
|
|
onDestinationSelected: (int index) {
|
|
setState(() {
|
|
_selectedIndex = index;
|
|
});
|
|
},
|
|
selectedIndex: _selectedIndex,
|
|
destinations: [
|
|
NavigationDestination(icon: Icon(Icons.home), label: "Home"),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.access_time),
|
|
label: "Verlauf",
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.health_and_safety),
|
|
label: "Auswertungen",
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|