feat: adjust search styling
parent
d131e1263c
commit
6ebdb39760
|
@ -54,64 +54,73 @@ class _SearchFoodComponentState extends State<SearchedFoodComponent> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
||||
decoration:
|
||||
const BoxDecoration(color: Color.fromARGB(234, 234, 123, 5)),
|
||||
child: WrapSuper(
|
||||
spacing: 32,
|
||||
wrapType: WrapType.balanced,
|
||||
wrapFit: WrapFit.larger,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.6,
|
||||
child: Text(
|
||||
widget.food.name,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
softWrap: false,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
||||
margin: const EdgeInsets.only(top:8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.lightGreen,
|
||||
borderRadius: BorderRadius.circular(5), // Rounded corners with 5px radius
|
||||
),
|
||||
child: WrapSuper(
|
||||
spacing: 32,
|
||||
wrapType: WrapType.balanced,
|
||||
wrapFit: WrapFit.larger,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: Text(
|
||||
widget.food.name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
softWrap: false,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.6,
|
||||
child: Text(
|
||||
"${widget.food.fatg} 100g "
|
||||
"${widget.food.calories} 100g "
|
||||
"${widget.food.carbohydrateg.toString()} 100g",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
softWrap: false,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
storeFood();
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white,
|
||||
backgroundColor: Colors.green,
|
||||
shadowColor: Colors.greenAccent,
|
||||
elevation: 3,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(32.0)),
|
||||
maximumSize: Size(
|
||||
MediaQuery.of(context).size.width * 0.2, 36), //////// HERE
|
||||
),
|
||||
child: const Text('+'),
|
||||
)
|
||||
],
|
||||
));
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: Text(
|
||||
"${widget.food.calories} kcal/100g",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
softWrap: false,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
storeFood();
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white,
|
||||
backgroundColor: Colors.green,
|
||||
shadowColor: Colors.greenAccent,
|
||||
elevation: 3,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(32.0),
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
'+',
|
||||
style: TextStyle(
|
||||
fontSize: 25
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue