36 lines
851 B
Dart
36 lines
851 B
Dart
import 'package:flutter/material.dart';
|
|
import 'sample_data.dart';
|
|
|
|
/* todo:
|
|
- Flag für Ansicht/Bearbeitung
|
|
- individuelle Icons je nach Kategorie
|
|
- Pfand
|
|
- Gesamtpreis
|
|
*/
|
|
|
|
class ShowBasket extends StatelessWidget {
|
|
final Transaction transaction;
|
|
|
|
const ShowBasket({super.key, required this.transaction});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListView.builder(
|
|
itemCount: null,
|
|
itemBuilder: (context, index) {
|
|
if (index < transaction.basket!.length) {
|
|
return Card(
|
|
child: ListTile(
|
|
leading: const Icon(Icons.abc),
|
|
title: Text(
|
|
transaction.basket![index].products.name), //better null check
|
|
//trailing: Text(),
|
|
),
|
|
);
|
|
} else {
|
|
return null;
|
|
}
|
|
},
|
|
);
|
|
}
|
|
}
|