I’m trying to create this design
but the image is not exactly where it should to be.
here is my code
Stack(
children: [
Container(
width: width * 0.9,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
gradient: const LinearGradient(
begin: Alignment.centerRight,
end: Alignment.bottomLeft,
colors: [
AppColors.orangeColorLight,
AppColors.orangeColorDark
],
),
),
child: Padding(
padding: const EdgeInsets.only(left: 20, top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
customText(context),
const SizedBox(height: 10,),
getNowBtn()
],
),
),
),
Positioned(
right: 0, // Adjust this value according to your requirement
bottom: 0, // Adjust this value according to your requirement
child: Image.asset(MediaConstants.menImage, width: width * 0.49,height: height*0.2,),
),
],
);
my code output
2
Answers
Try below code:
Result:
the image height should not be limited to the container
to do that you should put the entire stack widget in a sized box and give it a height slightly bigger than that of the container.