extremely simplyfied code
This commit is contained in:
parent
99282eb9da
commit
f343214df0
3 changed files with 16 additions and 24 deletions
|
@ -1,5 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
//this was used in a earlier version of the app and will possibly be removed in future versions.
|
||||
|
||||
class Expand extends StatefulWidget {
|
||||
final Widget child;
|
||||
final bool expand;
|
||||
|
|
|
@ -24,15 +24,8 @@ class Transaction {
|
|||
Transaction(this.art, this.betrag, this.datum, this.beschreibung);
|
||||
}
|
||||
|
||||
class Finance extends StatefulWidget {
|
||||
const Finance({super.key});
|
||||
|
||||
@override
|
||||
State<Finance> createState() => _Finance();
|
||||
}
|
||||
|
||||
//sample data
|
||||
class _Finance extends State<Finance> {
|
||||
class Finance extends StatelessWidget {
|
||||
final List<Transaction> transactions = [
|
||||
Transaction(Art.monatlBeitrag, 0, now, ''),
|
||||
Transaction(Art.aufladung, 2042, now, ''),
|
||||
|
@ -61,6 +54,8 @@ class _Finance extends State<Finance> {
|
|||
'Korrektur des Warenkorbs')
|
||||
];
|
||||
|
||||
Finance({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
initializeDateFormatting('de_DE');
|
||||
|
@ -76,7 +71,6 @@ class _Finance extends State<Finance> {
|
|||
children: [
|
||||
Icon(
|
||||
Icons.euro,
|
||||
//color: Colors.black,
|
||||
//semanticLabel: 'Text for screenreader',
|
||||
),
|
||||
Column(
|
||||
|
@ -106,8 +100,12 @@ class _Finance extends State<Finance> {
|
|||
onTap: () {
|
||||
transactions[index].elevated =
|
||||
!transactions[index].elevated;
|
||||
setState(() {});
|
||||
debugPrint('Card tapped');
|
||||
showBottomSheet(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return SizedBox.expand(
|
||||
child: Text(transactions[index].beschreibung));
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
@ -119,19 +117,11 @@ class _Finance extends State<Finance> {
|
|||
: Icons.money),
|
||||
Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(DateFormat(
|
||||
"EEEE, dd. MMMM yyyy HH:mm", 'de_DE')
|
||||
Text(
|
||||
DateFormat("EEEE, dd. MMMM yyyy HH:mm", 'de_DE')
|
||||
.format(now)),
|
||||
Text(
|
||||
'${transactions[index].art}: ${transactions[index].betrag / 100}€'),
|
||||
],
|
||||
),
|
||||
if (transactions[index].beschreibung != '')
|
||||
Expand(
|
||||
expand: transactions[index].elevated,
|
||||
child: Text(transactions[index].beschreibung))
|
||||
Text(
|
||||
'${transactions[index].art}: ${transactions[index].betrag / 100}€')
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
@ -81,7 +81,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
alignment: Alignment.center,
|
||||
child: Text('Page $test'),
|
||||
),
|
||||
const Finance(),
|
||||
Finance(),
|
||||
const Text(
|
||||
'Hier könnten Einstellungen zu Darkmode mit shared_preferences und riverpod sein')
|
||||
][currentPageIndex],
|
||||
|
|
Loading…
Reference in a new issue