introduction_screen
introduction_screen copied to clipboard
Overflow error for dots navigation
Using: v3.0.2 Flutter: 2.10.4 Emulator: Pixel 5 API 30 Resolution: 1080 x 2340 dp: 393x851

I haven't messed with the intro screens in ages, but suddenly noticed this overflow today. (See screenshot.) I tried changing the "nextFlex" value around. It just moves the dots left and right. Oddly, I can't get the dots to center themselves on the screen.
If I remove two of the intro screens then the overflow fits. Obviously, that's not a solution.
Here's the error msg:
The following assertion was thrown during layout:
A RenderFlex overflowed by 32 pixels on the right.
The relevant error-causing widget was:
IntroductionScreen-[LabeledGlobalKey<IntroductionScreenState>#0db96]
The overflowing RenderFlex has an orientation of Axis.horizontal.
The edge of the RenderFlex that is overflowing has been marked in
the rendering with a yellow and black striped pattern. This is
usually caused by the contents being too big for the RenderFlex.
Consider applying a flex factor (e.g. using an Expanded widget)
to force the children of the RenderFlex to fit within the
available space instead of being sized to their natural size.
This is considered an error condition because it indicates that
there is content that cannot be seen. If the content is
legitimately bigger than the available space, consider clipping
it with a ClipRect widget before putting it in the flex, or using
a scrollable container rather than a Flex, like a ListView.
The specific RenderFlex in question is: RenderFlex#2acb8 relayoutBoundary=up8 OVERFLOWING:
parentData:
constraints: BoxConstraints(0.0<=w<=120.2, 0.0<=h<=Infinity)
size: Size(120.2, 22.0)
direction: horizontal
mainAxisAlignment: center
mainAxisSize: min
crossAxisAlignment: center
textDirection: ltr
verticalDirection: down
same here.
same, is like is designed for 6 pages maximum, and the alineation of the dots is not center. (this can interfer with "next" button)
I have 5 pages, and I also got an overflow. I resolved it by using this:
// Default is EdgeInsets.all(16.0), but this causes horizontal overflow on Pixel 3
controlsPadding: const EdgeInsets.symmetric(horizontal: 0.0),
i think i resolve it by changing the flex property
same as Icyper, putting dotsFlex property fixed it for me
Thanks all for letting everyone know your solution! :-)
Closing.