Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot run this code with flutter 3.3.7 #54

Open
joyhope opened this issue Nov 10, 2022 · 2 comments
Open

cannot run this code with flutter 3.3.7 #54

joyhope opened this issue Nov 10, 2022 · 2 comments

Comments

@joyhope
Copy link

joyhope commented Nov 10, 2022

flutter run -d chrome

══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during performLayout():
RenderFlex children have non-zero flex but incoming height constraints are unbounded.
When a column is in a parent that does not provide a finite height constraint, for example if it is
in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a
flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining
space in the vertical direction.
These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child
cannot simultaneously expand to fit its parent.
Consider setting mainAxisSize to MainAxisSize.min and using FlexFit.loose fits for the flexible
children (using Flexible rather than Expanded). This will allow the flexible children to size
themselves to less than the infinite remaining space they would otherwise be forced to take, and
then will cause the RenderFlex to shrink-wrap the children rather than expanding to fit the maximum
constraints provided by the parent.
If this message did not help you determine the problem, consider using debugDumpRenderTree():
https://flutter.dev/debugging/#rendering-layer
http://api.flutter.dev/flutter/rendering/debugDumpRenderTree.html
The affected RenderFlex is:
RenderFlex#815cd relayoutBoundary=up33 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE(creator: Column ←
RepaintBoundary ← CustomPaint-[GlobalKey#62255] ← MouseRegion ← Listener ← _GestureSemantics ← RawGestureDetector ←
RepaintBoundary ← NotificationListener ← NotificationListener ←
_MaterialScrollbar ← Scrollbar ← ⋯, parentData: (can use size), constraints: BoxConstraints(w=582.3, 0.0<=h<=Infinity),
size: MISSING, direction: vertical, mainAxisAlignment: start, mainAxisSize: min, crossAxisAlignment: center,
verticalDirection: down)
The creator information is set to:
Column ← RepaintBoundary ← CustomPaint-[GlobalKey#62255] ← MouseRegion ← Listener ←
_GestureSemantics ← RawGestureDetector ← RepaintBoundary ←
NotificationListener ← NotificationListener ←
_MaterialScrollbar ← Scrollbar ← ⋯
The nearest ancestor providing an unbounded width constraint is: _RenderSingleChildViewport#7008e relayoutBoundary=up16
NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
needs compositing
creator: _SingleChildViewport ← IgnorePointer-[GlobalKey#9d247] ← Semantics ← Listener ←
_GestureSemantics ← RawGestureDetector-[LabeledGlobalKey#9c75f] ←
Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#975b4] ←
NotificationListener ← RepaintBoundary ← CustomPaint-[GlobalKey#81613]
← ⋯
parentData: (can use size)
constraints: BoxConstraints(w=908.0, 0.0<=h<=953.0)
size: MISSING
offset: Offset(0.0, -0.0)

@purinda
Copy link

purinda commented Nov 27, 2022

Have the same problem.

@hbbbs
Copy link

hbbbs commented Jan 30, 2023

I also encountered the same problem and solved it using the following link:
#53 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants