forked from mgl_crew/Mitgliederladen
main #1
4 changed files with 91 additions and 64 deletions
|
@ -4,7 +4,6 @@ import 'sample_data.dart';
|
||||||
/* todo:
|
/* todo:
|
||||||
- Flag für Ansicht/Bearbeitung
|
- Flag für Ansicht/Bearbeitung
|
||||||
- individuelle Icons je nach Kategorie
|
- individuelle Icons je nach Kategorie
|
||||||
- Pfand
|
|
||||||
- Gesamtpreis
|
- Gesamtpreis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import 'sample_data.dart';
|
||||||
todo:
|
todo:
|
||||||
- Einkauf und Settings
|
- Einkauf und Settings
|
||||||
- Warenkorb
|
- Warenkorb
|
||||||
- Aufladungen?
|
|
||||||
- farbliche Hervorhebungen
|
- farbliche Hervorhebungen
|
||||||
- semanticLabels, Screenreader
|
- semanticLabels, Screenreader
|
||||||
- monatliche Aufladung: ausstehende Beträge
|
- monatliche Aufladung: ausstehende Beträge
|
||||||
|
|
|
@ -76,11 +76,20 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: <Widget>[
|
body: <Widget>[
|
||||||
Container(
|
Scaffold(
|
||||||
color: Colors.red,
|
floatingActionButton: FloatingActionButton(
|
||||||
|
child: const Icon(Icons.shopping_cart),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
test++;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
color: Colors.green,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text('Page $test'),
|
child: Text('Page $test'),
|
||||||
),
|
)),
|
||||||
const Finance(),
|
const Finance(),
|
||||||
ListView(children: const <Widget>[
|
ListView(children: const <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
final now = DateTime.now();
|
final DateTime now = DateTime.now();
|
||||||
|
|
||||||
enum TransaktionArt { monatlBeitrag, aufladung, einkauf, korrektur }
|
enum TransaktionArt { monatlBeitrag, aufladung, einkauf, korrektur }
|
||||||
|
|
||||||
|
@ -11,7 +11,8 @@ enum Category {
|
||||||
drogerieUndHaushalt,
|
drogerieUndHaushalt,
|
||||||
kochenUndBacken,
|
kochenUndBacken,
|
||||||
oeleSossenUndGewuerze,
|
oeleSossenUndGewuerze,
|
||||||
suessesUndKnabbereien
|
suessesUndKnabbereien,
|
||||||
|
pfand
|
||||||
}
|
}
|
||||||
|
|
||||||
class Transaction {
|
class Transaction {
|
||||||
|
@ -21,8 +22,12 @@ class Transaction {
|
||||||
DateTime date;
|
DateTime date;
|
||||||
List<Basket>? basket;
|
List<Basket>? basket;
|
||||||
String? description;
|
String? description;
|
||||||
Transaction(this.type, this.amount, this.date,
|
Transaction(
|
||||||
{this.description, this.basket});
|
{required this.type,
|
||||||
|
required this.amount,
|
||||||
|
required this.date,
|
||||||
|
this.description,
|
||||||
|
this.basket});
|
||||||
}
|
}
|
||||||
|
|
||||||
class Product {
|
class Product {
|
||||||
|
@ -49,7 +54,8 @@ class SampleData {
|
||||||
Product('Milch', Unit.stueck, 2.23, 3, Category.getraenke),
|
Product('Milch', Unit.stueck, 2.23, 3, Category.getraenke),
|
||||||
Product('Zahnpasta', Unit.stueck, 0.23, 7, Category.drogerieUndHaushalt),
|
Product('Zahnpasta', Unit.stueck, 0.23, 7, Category.drogerieUndHaushalt),
|
||||||
Product('Pfeffer', Unit.stueck, 0.23, 7, Category.oeleSossenUndGewuerze),
|
Product('Pfeffer', Unit.stueck, 0.23, 7, Category.oeleSossenUndGewuerze),
|
||||||
Product('Schokolade', Unit.menge, 0.23, 7, Category.suessesUndKnabbereien)
|
Product('Schokolade', Unit.menge, 0.23, 7, Category.suessesUndKnabbereien),
|
||||||
|
Product('Flaschenpfand', Unit.stueck, -0.15, 0, Category.pfand)
|
||||||
];
|
];
|
||||||
|
|
||||||
static List<Basket> basket = [
|
static List<Basket> basket = [
|
||||||
|
@ -67,7 +73,8 @@ class SampleData {
|
||||||
Basket(products[1], 2241),
|
Basket(products[1], 2241),
|
||||||
Basket(products[3], 2),
|
Basket(products[3], 2),
|
||||||
Basket(products[4], 4),
|
Basket(products[4], 4),
|
||||||
Basket(products[6], 2)
|
Basket(products[6], 2),
|
||||||
|
Basket(products[7], 5)
|
||||||
];
|
];
|
||||||
|
|
||||||
static List<Basket> basket3 = [
|
static List<Basket> basket3 = [
|
||||||
|
@ -80,94 +87,107 @@ class SampleData {
|
||||||
|
|
||||||
List<Transaction> transactions = [
|
List<Transaction> transactions = [
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.monatlBeitrag,
|
type: TransaktionArt.monatlBeitrag,
|
||||||
0,
|
amount: 0,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.aufladung,
|
type: TransaktionArt.aufladung,
|
||||||
2042,
|
amount: 2042,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.einkauf,
|
type: TransaktionArt.einkauf,
|
||||||
-2442,
|
amount: -2442,
|
||||||
now.subtract(const Duration(days: 2)),
|
date: now.subtract(const Duration(days: 2)),
|
||||||
),
|
basket: basket),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.korrektur,
|
type: TransaktionArt.korrektur,
|
||||||
2332,
|
amount: 2332,
|
||||||
now.subtract(const Duration(hours: 5)),
|
date: now.subtract(const Duration(hours: 5)),
|
||||||
description: 'Korrektur des Warenkorbs',
|
description: 'Korrektur des Warenkorbs',
|
||||||
basket: basket3,
|
basket: basket3,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.monatlBeitrag,
|
type: TransaktionArt.monatlBeitrag,
|
||||||
0,
|
amount: 0,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.aufladung,
|
type: TransaktionArt.aufladung,
|
||||||
2042,
|
amount: 2042,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.einkauf, -2442, now.subtract(const Duration(days: 2)),
|
type: TransaktionArt.einkauf,
|
||||||
|
amount: -2442,
|
||||||
|
date: now.subtract(const Duration(days: 2)),
|
||||||
basket: basket2),
|
basket: basket2),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.korrektur, 2332, now.subtract(const Duration(hours: 5)),
|
type: TransaktionArt.korrektur,
|
||||||
description: 'Korrektur des Warenkorbs'),
|
amount: 2332,
|
||||||
|
date: now.subtract(const Duration(hours: 5)),
|
||||||
|
description: 'Korrektur des FinanzAK'),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.monatlBeitrag,
|
type: TransaktionArt.monatlBeitrag,
|
||||||
0,
|
amount: 0,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.aufladung,
|
type: TransaktionArt.aufladung,
|
||||||
2042,
|
amount: 2042,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.einkauf,
|
type: TransaktionArt.einkauf,
|
||||||
-2442,
|
amount: -2442,
|
||||||
now.subtract(const Duration(days: 2)),
|
date: now.subtract(const Duration(days: 2)),
|
||||||
basket: basket,
|
basket: basket,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.korrektur, 2332, now.subtract(const Duration(hours: 5)),
|
type: TransaktionArt.korrektur,
|
||||||
|
amount: 2332,
|
||||||
|
date: now.subtract(const Duration(hours: 5)),
|
||||||
description: 'Korrektur des Warenkorbs'),
|
description: 'Korrektur des Warenkorbs'),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.monatlBeitrag,
|
type: TransaktionArt.monatlBeitrag,
|
||||||
0,
|
amount: 0,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.aufladung,
|
type: TransaktionArt.aufladung,
|
||||||
2042,
|
amount: 2042,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.einkauf, -2442, now.subtract(const Duration(days: 2))),
|
type: TransaktionArt.einkauf,
|
||||||
|
amount: -2442,
|
||||||
|
date: now.subtract(const Duration(days: 2)),
|
||||||
|
basket: basket),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.korrektur, 2332, now.subtract(const Duration(hours: 5)),
|
type: TransaktionArt.korrektur,
|
||||||
|
amount: 2332,
|
||||||
|
date: now.subtract(const Duration(hours: 5)),
|
||||||
description: 'Korrektur des Warenkorbs'),
|
description: 'Korrektur des Warenkorbs'),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.monatlBeitrag,
|
type: TransaktionArt.monatlBeitrag,
|
||||||
0,
|
amount: 0,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.aufladung,
|
type: TransaktionArt.aufladung,
|
||||||
2042,
|
amount: 2042,
|
||||||
now,
|
date: now,
|
||||||
),
|
),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.einkauf,
|
type: TransaktionArt.einkauf,
|
||||||
-2442,
|
amount: -2442,
|
||||||
now.subtract(const Duration(days: 2)),
|
date: now.subtract(const Duration(days: 2)),
|
||||||
),
|
basket: basket2),
|
||||||
Transaction(
|
Transaction(
|
||||||
TransaktionArt.korrektur, 2332, now.subtract(const Duration(hours: 5)),
|
type: TransaktionArt.korrektur,
|
||||||
|
amount: 2332,
|
||||||
|
date: now.subtract(const Duration(hours: 5)),
|
||||||
description: 'Korrektur des Warenkorbs'),
|
description: 'Korrektur des Warenkorbs'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue