I am following a tutorial from youtube and not able to position image as shown in the image below.
My current state is shown here My current state
Widget build(BuildContext context) {
return Column(
children: [
GestureDetector(
onTap: onTap,
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Food text
Text(food.name),
Text(
'$' + food.price.toString(),
style: TextStyle(
color: Theme.of(context).colorScheme.primary),
),
const SizedBox(
height: 10,
),
Text(
food.description,
style: TextStyle(
color: Theme.of(context).colorScheme.inversePrimary),
),
],
)),
// const SizedBox(
// width: 15,
// ),
// Food image
Image.asset(
food.imagePath,
height: 120,
width: 120,
),
],
),
),
),
What am I missing here?
2
Answers
To make sure your image scales properly and has smooth, polished edges when you add rounded corners, you can use the ClipRRect widget in Flutter. By setting the clipBehavior property to Clip.antiAlias, you’ll get smoother edges, which makes the overall look more refined.
Here’s an example of how you can do this:
Try