forked from mgl_crew/Mitgliederladen
89 lines
2.4 KiB
Dart
89 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:mitgliederladen/shopping.dart';
|
|
import 'package:mitgliederladen/settings.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(
|
|
//darkgreen:5f7c61, mediumgreen: 66906a, lightgreen: 9cbe96, yellow: f5de64
|
|
useMaterial3: true,
|
|
brightness: Brightness.light,
|
|
textTheme: Typography.englishLike2021,
|
|
colorScheme: ColorScheme.fromSeed(
|
|
brightness: Brightness.light,
|
|
seedColor: const Color(0xff5f7c61))),
|
|
darkTheme: ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
textTheme: Typography.englishLike2021,
|
|
colorScheme: ColorScheme.fromSeed(
|
|
brightness: Brightness.dark,
|
|
seedColor: const Color(0xff5f7c61),
|
|
)),
|
|
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(
|
|
leading:
|
|
const Image(image: AssetImage('assets/logo_sonako_4c_optimal.png')),
|
|
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>[
|
|
const Shopping(),
|
|
const Finance(),
|
|
const Settings()
|
|
][currentPageIndex],
|
|
);
|
|
}
|
|
}
|