fertig bis auf Tankstellen und Graph
This commit is contained in:
@@ -11,6 +11,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var detailCtrl = controller;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.blueGrey,
|
||||
@@ -42,7 +43,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Header Card mit Datum und Gesamtpreis
|
||||
DetailHeaderWidget(tank: controller.tank),
|
||||
DetailHeaderWidget(tank: detailCtrl.tank),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
|
||||
@@ -53,8 +54,8 @@ class DetailPage extends GetView<DetailController> {
|
||||
DetailStatWidget(
|
||||
icon: Icons.location_on,
|
||||
label: 'Standort',
|
||||
value: controller.tank.szLocation.isNotEmpty
|
||||
? controller.tank.szLocation
|
||||
value: detailCtrl.tank.szLocation.isNotEmpty
|
||||
? detailCtrl.tank.szLocation
|
||||
: 'Nicht angegeben',
|
||||
iconColor: Colors.red,
|
||||
),
|
||||
@@ -62,7 +63,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
DetailStatWidget(
|
||||
icon: Icons.calendar_today,
|
||||
label: 'Datum',
|
||||
value: controller.tank.szDate,
|
||||
value: detailCtrl.tank.szDate,
|
||||
iconColor: Colors.blueGrey,
|
||||
),
|
||||
],
|
||||
@@ -77,7 +78,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
DetailStatWidget(
|
||||
icon: Icons.local_gas_station,
|
||||
label: 'Liter getankt',
|
||||
value: '${controller.tank.szLiters} L',
|
||||
value: '${detailCtrl.tank.szLiters} L',
|
||||
iconColor: Colors.orange,
|
||||
valueSize: 24,
|
||||
valueWeight: FontWeight.bold,
|
||||
@@ -89,7 +90,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
child: DetailStatWidget(
|
||||
icon: Icons.euro,
|
||||
label: 'Preis pro Liter',
|
||||
value: '${controller.tank.szPricePerLiter}€',
|
||||
value: '${detailCtrl.tank.szPricePerLiter}€',
|
||||
iconColor: Colors.green,
|
||||
),
|
||||
),
|
||||
@@ -98,7 +99,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
child: DetailStatWidget(
|
||||
icon: Icons.receipt,
|
||||
label: 'Gesamtpreis',
|
||||
value: '${controller.tank.szPriceTotal}€',
|
||||
value: '${detailCtrl.tank.szPriceTotal}€',
|
||||
iconColor: Colors.green[700]!,
|
||||
valueWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -117,7 +118,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
DetailStatWidget(
|
||||
icon: Icons.speed,
|
||||
label: 'Kilometerstand',
|
||||
value: '${controller.tank.szOdometer} km',
|
||||
value: '${detailCtrl.tank.szOdometer} km',
|
||||
iconColor: Colors.blue,
|
||||
valueSize: 24,
|
||||
valueWeight: FontWeight.bold,
|
||||
@@ -134,6 +135,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// Bearbeiten Funktion
|
||||
detailCtrl.editEntry();
|
||||
},
|
||||
icon: const Icon(Icons.edit),
|
||||
label: const Text('Bearbeiten'),
|
||||
@@ -152,6 +154,7 @@ class DetailPage extends GetView<DetailController> {
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// Löschen Funktion
|
||||
detailCtrl.deleteEntry();
|
||||
},
|
||||
icon: const Icon(Icons.delete),
|
||||
label: const Text('Löschen'),
|
||||
|
||||
Reference in New Issue
Block a user