36 lines
1.2 KiB
Dart
36 lines
1.2 KiB
Dart
|
import 'package:ernaehrung/android/components/card/card_food_item_component.dart';
|
||
|
import 'package:ernaehrung/android/models/food.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class CardDataFoodComponent extends StatelessWidget {
|
||
|
final List<Food> foods;
|
||
|
|
||
|
const CardDataFoodComponent(this.foods, {Key? key}) : super(key: key);
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Container(
|
||
|
height: 180,
|
||
|
decoration: const BoxDecoration(
|
||
|
color: Colors.pink,
|
||
|
borderRadius: BorderRadius.all(Radius.circular(16))),
|
||
|
child: Padding(
|
||
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
|
||
|
child: SingleChildScrollView(
|
||
|
child: Column(
|
||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||
|
children: [
|
||
|
ListView.builder(
|
||
|
physics: const NeverScrollableScrollPhysics(),
|
||
|
shrinkWrap: true,
|
||
|
itemCount: foods.length,
|
||
|
itemBuilder: (context, i) {
|
||
|
return CardFoodItemComponent(foods[i]);
|
||
|
})
|
||
|
],
|
||
|
),
|
||
|
)),
|
||
|
);
|
||
|
}
|
||
|
}
|