i’m trying to test flutter app on ipad pro in debug mode and showing error of "A RenderFlex overflowed by 453 pixels on the right." and if i use singlechildlistview then show blank screen.
Here is the code:
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
SvgPicture.asset(
"assets/icons/ic_location.svg",
height: 24,
),
SizedBox(
width: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: Get.width / 4,
height: 12,
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(4)),
),
Icon(
Icons.keyboard_arrow_down,
color: Colors.black,
size: 16,
)
],
),
SizedBox(
height: 8,
),
Container(
width: Get.width - 100,
height: 12,
decoration: BoxDecoration(
color: color, borderRadius: BorderRadius.circular(4)),
),
SizedBox(
height: 8,
),
],
),
],
),
)
2
Answers
Please share the whole build method, we need to know the parent of the SingleChildScrollView but my best guess is you will solve your issue by wrapping the SingleChildScrollView with Expanded so that it knows how much space it can take (since it’s unbounded right now hence the error of overflow.)
Parent of
SingleChildScrollView
is needed to give a solution.But I can assume, you have some other widget at the left to show, which causing the issue.
Remove
SingleChildScrollView
from the child and Wrap the parent widget withSingleChildScrollView
.