This repository has been archived on 2026-03-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
pblv-demoapp/lib/main.dart
2026-02-04 11:49:49 +01:00

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",
),
],
),
);
}
}