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 {
|
|
|
|
ShowBasket({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ListView.builder(
|
|
|
|
itemCount: null,
|
|
|
|
itemBuilder: (context, index) {
|
2023-06-23 13:03:17 +02:00
|
|
|
if (index < SampleData().basket.purchases.length) {
|
2023-06-23 10:54:25 +02:00
|
|
|
return Card(
|
|
|
|
child: ListTile(
|
|
|
|
leading: const Icon(Icons.abc),
|
2023-06-23 13:03:17 +02:00
|
|
|
title: Text(SampleData().basket.purchases[index].product.name),
|
2023-06-23 10:54:25 +02:00
|
|
|
//trailing: Text(),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|