Mitgliederladen/Frontend-user/lib/main.dart

107 lines
2.9 KiB
Dart
Raw Normal View History

2023-06-12 23:06:20 +02:00
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(
2023-06-19 11:21:54 +02:00
//darkgreen:5f7c61, mediumgreen: 66906a, lightgreen: 9cbe96, yellow: f5de64
2023-06-12 23:06:20 +02:00
useMaterial3: true,
2023-06-19 11:21:54 +02:00
brightness: Brightness.light,
2023-06-12 23:06:20 +02:00
colorScheme: ColorScheme.fromSeed(
2023-06-19 11:21:54 +02:00
brightness: Brightness.light,
seedColor: const Color(0xff5f7c61))),
darkTheme: ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.dark,
seedColor: const Color(0xff5f7c61),
)),
2023-06-25 15:11:23 +02:00
themeMode: ThemeMode.system,
2023-06-12 23:06:20 +02:00
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(
2023-06-16 15:36:13 +02:00
leading:
const Image(image: AssetImage('assets/logo_sonako_4c_optimal.png')),
2023-06-12 23:06:20 +02:00
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>[
2023-06-25 14:01:19 +02:00
Scaffold(
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.shopping_cart),
onPressed: () {
setState(() {
test++;
});
},
),
body: Container(
color: Colors.green,
alignment: Alignment.center,
child: Text('Page $test'),
)),
2023-06-25 12:04:17 +02:00
const Finance(),
2023-06-19 20:29:17 +02:00
ListView(children: const <Widget>[
ListTile(
leading: Icon(Icons.dark_mode),
title: Text(
'Hier könnten Einstellungen zu Darkmode mit shared_preferences und riverpod sein',
maxLines: 2,
),
)
])
2023-06-12 23:06:20 +02:00
][currentPageIndex],
);
}
}