add edit and delete
This commit is contained in:
@@ -2,11 +2,13 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../data/models/tank_model.dart';
|
||||
|
||||
|
||||
class MyListTileItem extends StatelessWidget {
|
||||
const MyListTileItem({super.key, required this.listItem});
|
||||
const MyListTileItem(
|
||||
{super.key, required this.listItem, required this.onPressedEdit, required this.onPressedDelete});
|
||||
|
||||
final AppWriteTankModel listItem;
|
||||
final void Function()? onPressedEdit;
|
||||
final void Function()? onPressedDelete;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -72,7 +74,8 @@ class MyListTileItem extends StatelessWidget {
|
||||
children: [
|
||||
Icon(Icons.price_change),
|
||||
SizedBox(width: 10),
|
||||
Text('${listItem.szSummePreis} €', style: TextStyle(color: textColor, fontSize: 25)),
|
||||
Text('${listItem.szSummePreis} €',
|
||||
style: TextStyle(color: textColor, fontSize: 25)),
|
||||
],
|
||||
),
|
||||
Divider(thickness: 1, color: Colors.black),
|
||||
@@ -89,6 +92,38 @@ class MyListTileItem extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(thickness: 1, color: Colors.black),
|
||||
Wrap(
|
||||
spacing: 10,
|
||||
children: [
|
||||
ElevatedButton.icon(
|
||||
onPressed: onPressedEdit,
|
||||
label: Text(
|
||||
'Edit',
|
||||
style: TextStyle(color: Colors.grey.shade200),
|
||||
),
|
||||
icon: const Icon(Icons.edit),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color.fromARGB(255, 3, 71, 128),
|
||||
foregroundColor: Colors.grey.shade200,
|
||||
shadowColor: Colors.white,
|
||||
),
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
onPressed: onPressedDelete,
|
||||
label: Text(
|
||||
'Delete',
|
||||
style: TextStyle(color: Colors.grey.shade200),
|
||||
),
|
||||
icon: const Icon(Icons.delete),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color.fromARGB(255, 128, 3, 45),
|
||||
foregroundColor: Colors.grey.shade200,
|
||||
shadowColor: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user