forked from mgl_crew/Mitgliederladen
80 lines
1.9 KiB
Dart
80 lines
1.9 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'finance.dart';
|
||
|
|
||
|
void main() {
|
||
|
runApp(const MyApp());
|
||
|
}
|
||
|
|
||
|
class MyApp extends StatelessWidget {
|
||
|
const MyApp({super.key});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return MaterialApp(
|
||
|
title: 'SoNaKo Demo App',
|
||
|
debugShowCheckedModeBanner: false,
|
||
|
theme: ThemeData(
|
||
|
useMaterial3: true,
|
||
|
colorScheme: ColorScheme.fromSeed(
|
||
|
seedColor: Colors.green)), //9bbee6 //79,128,104
|
||
|
darkTheme: ThemeData.dark(),
|
||
|
themeMode: ThemeMode.system,
|
||
|
home: const MyHomePage(),
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class MyHomePage extends StatefulWidget {
|
||
|
const MyHomePage({super.key});
|
||
|
|
||
|
@override
|
||
|
State<MyHomePage> createState() => _MyHomePageState();
|
||
|
}
|
||
|
|
||
|
class _MyHomePageState extends State<MyHomePage> {
|
||
|
int currentPageIndex = 0;
|
||
|
int test = 0;
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Scaffold(
|
||
|
appBar: AppBar(
|
||
|
title: const Text('SoNaKo Demo App'),
|
||
|
),
|
||
|
bottomNavigationBar: NavigationBar(
|
||
|
onDestinationSelected: (int index) {
|
||
|
setState(() {
|
||
|
test++;
|
||
|
currentPageIndex = index;
|
||
|
});
|
||
|
},
|
||
|
selectedIndex: currentPageIndex,
|
||
|
destinations: const <Widget>[
|
||
|
NavigationDestination(
|
||
|
icon: Icon(Icons.shopping_cart),
|
||
|
label: 'Einkauf',
|
||
|
),
|
||
|
NavigationDestination(
|
||
|
icon: Icon(Icons.toll),
|
||
|
label: 'Finanzen',
|
||
|
),
|
||
|
NavigationDestination(
|
||
|
icon: Icon(Icons.settings),
|
||
|
label: 'Einstellungen',
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
body: <Widget>[
|
||
|
Container(
|
||
|
color: Colors.red,
|
||
|
alignment: Alignment.center,
|
||
|
child: Text('Page $test'),
|
||
|
),
|
||
|
Finance(),
|
||
|
const Text(
|
||
|
'Hier könnten Einstellungen zu Darkmode mit shared_preferences und riverpod sein')
|
||
|
][currentPageIndex],
|
||
|
);
|
||
|
}
|
||
|
}
|