I am using the pub dev packaged introduction_screen and I am having issues styling the different pages.
title: "",
bodyWidget: SizedBox(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Image.asset(
'images/FAQ/logo.png',
),
],
),
],
),
),
),
I would think it would fit the sized box but it goes outside of the sized box and does not auto scale to the phones screen size.
I have tried also setting the sizedBox width to double.infinity
but that didn't help either.
CodePudding user response:
The problem is you are having Column with Row as children. As you may know Column can have unbounded height and Row can have unbounded width, using both of them as an ancestor of your widget give unbounded height and width to the widget.
I would suggest you to either use
- Stack or Centre widget instead of Column/Row combo as ancestor of Image.asset or
- Use Column -> [Expanded -> Row -> [Expanded -> Image.asset]] in case you have other widget. You can position widgets according to your requirement.