feat: adjust search styling

pull/5/head
2211260 2023-06-02 18:35:07 +02:00
parent d131e1263c
commit 6ebdb39760
1 changed files with 65 additions and 56 deletions

View File

@ -55,8 +55,11 @@ class _SearchFoodComponentState extends State<SearchedFoodComponent> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16), padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
decoration: margin: const EdgeInsets.only(top:8),
const BoxDecoration(color: Color.fromARGB(234, 234, 123, 5)), decoration: BoxDecoration(
color: Colors.lightGreen,
borderRadius: BorderRadius.circular(5), // Rounded corners with 5px radius
),
child: WrapSuper( child: WrapSuper(
spacing: 32, spacing: 32,
wrapType: WrapType.balanced, wrapType: WrapType.balanced,
@ -66,31 +69,31 @@ class _SearchFoodComponentState extends State<SearchedFoodComponent> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.8,
child: Text( child: Text(
widget.food.name, widget.food.name,
maxLines: 1, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
softWrap: false, softWrap: false,
style: const TextStyle( style: const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 20.0), fontSize: 20.0,
),
), ),
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.8,
child: Text( child: Text(
"${widget.food.fatg} 100g " "${widget.food.calories} kcal/100g",
"${widget.food.calories} 100g "
"${widget.food.carbohydrateg.toString()} 100g",
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
softWrap: false, softWrap: false,
style: const TextStyle( style: const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 20.0), fontSize: 20.0,
),
), ),
), ),
], ],
@ -105,13 +108,19 @@ class _SearchFoodComponentState extends State<SearchedFoodComponent> {
shadowColor: Colors.greenAccent, shadowColor: Colors.greenAccent,
elevation: 3, elevation: 3,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(32.0)), borderRadius: BorderRadius.circular(32.0),
maximumSize: Size( ),
MediaQuery.of(context).size.width * 0.2, 36), //////// HERE ),
child: const Text(
'+',
style: TextStyle(
fontSize: 25
),
),
), ),
child: const Text('+'),
)
], ],
)); ),
);
} }
} }