Mitgliederladen/Frontend-user/lib/basket.dart
2023-06-25 14:01:19 +02:00

35 lines
841 B
Dart

import 'package:flutter/material.dart';
import 'sample_data.dart';
/* todo:
- Flag für Ansicht/Bearbeitung
- individuelle Icons je nach Kategorie
- 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;
}
},
);
}
}