Mitgliederladen/Frontend-user/lib/basket.dart

37 lines
851 B
Dart
Raw Normal View History

2023-06-23 10:54:25 +02:00
import 'package:flutter/material.dart';
2023-06-23 13:03:17 +02:00
import 'sample_data.dart';
2023-06-23 10:54:25 +02:00
/* todo:
- Flag für Ansicht/Bearbeitung
- individuelle Icons je nach Kategorie
- Pfand
- Gesamtpreis
*/
class ShowBasket extends StatelessWidget {
2023-06-25 12:04:17 +02:00
final Transaction transaction;
const ShowBasket({super.key, required this.transaction});
2023-06-23 10:54:25 +02:00
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: null,
itemBuilder: (context, index) {
2023-06-25 12:04:17 +02:00
if (index < transaction.basket!.length) {
2023-06-23 10:54:25 +02:00
return Card(
child: ListTile(
leading: const Icon(Icons.abc),
2023-06-25 12:04:17 +02:00
title: Text(
transaction.basket![index].products.name), //better null check
2023-06-23 10:54:25 +02:00
//trailing: Text(),
),
);
} else {
return null;
}
},
);
}
}