forked from mgl_crew/Mitgliederladen
main #1
4 changed files with 47 additions and 19 deletions
|
@ -4,7 +4,7 @@ import 'sample_data.dart';
|
||||||
|
|
||||||
/* todo:
|
/* todo:
|
||||||
- individuelle Icons je nach Kategorie
|
- individuelle Icons je nach Kategorie
|
||||||
- Gesamtpreis
|
- editing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ShowBasket extends StatelessWidget {
|
class ShowBasket extends StatelessWidget {
|
||||||
|
@ -84,7 +84,7 @@ class ShowBasket extends StatelessWidget {
|
||||||
Widget getLeading(Category category) {
|
Widget getLeading(Category category) {
|
||||||
switch (category) {
|
switch (category) {
|
||||||
case Category.obstUndGemuese:
|
case Category.obstUndGemuese:
|
||||||
return const Text("🍅");
|
return const Text("🍒");
|
||||||
case Category.brotCerealienUndAufstriche:
|
case Category.brotCerealienUndAufstriche:
|
||||||
return const Text(
|
return const Text(
|
||||||
'🍞',
|
'🍞',
|
||||||
|
|
|
@ -7,11 +7,10 @@ import 'sample_data.dart';
|
||||||
/*
|
/*
|
||||||
todo:
|
todo:
|
||||||
- Einkauf und Settings
|
- Einkauf und Settings
|
||||||
- Warenkorb
|
|
||||||
- farbliche Hervorhebungen
|
- farbliche Hervorhebungen
|
||||||
- semanticLabels, Screenreader
|
- semanticLabels, Screenreader
|
||||||
- monatliche Aufladung: ausstehende Beträge
|
- monatliche Aufladung: ausstehende Beträge
|
||||||
- Icons: maybe flutter awesome
|
- Error-Management (throw)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Finance extends StatelessWidget {
|
class Finance extends StatelessWidget {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mitgliederladen/shopping.dart';
|
||||||
import 'finance.dart';
|
import 'finance.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -17,17 +18,19 @@ class MyApp extends StatelessWidget {
|
||||||
//darkgreen:5f7c61, mediumgreen: 66906a, lightgreen: 9cbe96, yellow: f5de64
|
//darkgreen:5f7c61, mediumgreen: 66906a, lightgreen: 9cbe96, yellow: f5de64
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
|
textTheme: Typography.englishLike2021,
|
||||||
colorScheme: ColorScheme.fromSeed(
|
colorScheme: ColorScheme.fromSeed(
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
seedColor: const Color(0xff5f7c61))),
|
seedColor: const Color(0xff5f7c61))),
|
||||||
darkTheme: ThemeData(
|
darkTheme: ThemeData(
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
|
textTheme: Typography.englishLike2021,
|
||||||
colorScheme: ColorScheme.fromSeed(
|
colorScheme: ColorScheme.fromSeed(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
seedColor: const Color(0xff5f7c61),
|
seedColor: const Color(0xff5f7c61),
|
||||||
)),
|
)),
|
||||||
themeMode: ThemeMode.system,
|
themeMode: ThemeMode.dark,
|
||||||
home: const MyHomePage(),
|
home: const MyHomePage(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -76,20 +79,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: <Widget>[
|
body: <Widget>[
|
||||||
Scaffold(
|
Shopping(),
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
child: const Icon(Icons.shopping_cart),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
test++;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
body: Container(
|
|
||||||
color: Colors.green,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Text('Page $test'),
|
|
||||||
)),
|
|
||||||
const Finance(),
|
const Finance(),
|
||||||
ListView(children: const <Widget>[
|
ListView(children: const <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|
39
Frontend-user/lib/shopping.dart
Normal file
39
Frontend-user/lib/shopping.dart
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Shopping extends StatelessWidget {
|
||||||
|
Shopping({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
child: const Icon(Icons.shopping_cart),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
body: GridView.builder(
|
||||||
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2),
|
||||||
|
itemBuilder: ((context, index) {
|
||||||
|
return Card(
|
||||||
|
child: Column(children: [
|
||||||
|
const Expanded(
|
||||||
|
child: FittedBox(
|
||||||
|
fit: BoxFit.scaleDown,
|
||||||
|
child: Text(
|
||||||
|
'🍒',
|
||||||
|
style: TextStyle(fontSize: 400),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
'Obst und Gemüse',
|
||||||
|
style: Theme.of(context).textTheme.labelLarge,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
})));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue