2023-05-29 22:04:44 +02:00
|
|
|
import 'package:ernaehrung/android/models/food.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class CardFoodItemComponent extends StatelessWidget {
|
|
|
|
final Food food;
|
|
|
|
|
|
|
|
const CardFoodItemComponent(this.food, {Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
2023-06-02 00:38:19 +02:00
|
|
|
margin: const EdgeInsets.fromLTRB(0, 8, 0, 4),
|
|
|
|
width: double.infinity,
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
food.name.toString(),
|
2023-06-02 19:21:06 +02:00
|
|
|
style: const TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 17,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
2023-06-02 00:38:19 +02:00
|
|
|
softWrap: true,
|
2023-06-02 19:21:06 +02:00
|
|
|
maxLines: 2,
|
2023-05-29 22:04:44 +02:00
|
|
|
),
|
2023-06-02 00:38:19 +02:00
|
|
|
Text(
|
2023-06-02 19:21:06 +02:00
|
|
|
"\n${food.calories.toString()} kcal | 100g",
|
2023-06-02 00:38:19 +02:00
|
|
|
style: const TextStyle(color: Colors.white),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
));
|
2023-05-29 22:04:44 +02:00
|
|
|
}
|
|
|
|
}
|