just_the_tooltip icon indicating copy to clipboard operation
just_the_tooltip copied to clipboard

Unhandled Exception: RenderFlex children have non-zero flex

Open sgehrman opened this issue 2 years ago • 2 comments

I reported this previously, but have the problem again.

try a test like:

Listview children: [ tooltip( child: Row(children: [Text, Expanded(Text), Button]) ) ] )

The tooltip code doesn't like that expanded row.

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: RenderFlex children have non-zero flex but incoming width constraints are unbounded. When a row is in a parent that does not provide a finite width constraint, for example if it is in a horizontal scrollable, it will try to shrink-wrap its children along the horizontal 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 horizontal 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.

sgehrman avatar Dec 24 '21 01:12 sgehrman

same issue two years later

sgehrman avatar May 03 '23 08:05 sgehrman

Same issue any fix for this?

ffuf-aarone avatar Jul 31 '23 08:07 ffuf-aarone