-6

Error

I/flutter (16321): The following RenderObject was being processed when the exception was fired:

I/flutter (16321): RenderIndexedStack#83b60 relayoutBoundary=up9 NEEDS-LAYOUT NEEDS-PAINT I/flutter (16321): creator: IndexedStack ← Row ← Padding ← Container ← DefaultTextStyle ← Stack ← Listener ← I/flutter (16321): _GestureSemantics ← RawGestureDetector ← GestureDetector ← Semantics ← DropdownButton ← ⋯ I/flutter (16321): parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size) I/flutter (16321): constraints: BoxConstraints(unconstrained) I/flutter (16321): size: Size(Infinity, Infinity) I/flutter (16321): alignment: AlignmentDirectional.centerStart I/flutter (16321): textDirection: ltr I/flutter (16321): fit: loose I/flutter (16321): overflow: clip I/flutter (16321): index: null I/flutter (16321): This RenderObject has no descendants. I/flutter (16321): ════════════════════════════════════════════════════════════════════════════════════════════════════ I/flutter (16321): Another exception was thrown: RenderFlex object was given an infinite size during layout. I/flutter (16321): Another exception was thrown: RenderPadding object was given an infinite size during layout. I/flutter (16321): Another exception was thrown: RenderStack object was given an infinite size during layout. I/flutter (16321): Another exception was thrown: RenderPointerListener object was given an infinite size during layout. I/flutter (16321): Another exception was thrown: RenderSemanticsGestureHandler object was given an infinite size during layout. I/flutter (16321): Another exception was thrown: RenderSemanticsAnnotations object was given an infinite size during layout. I/flutter (16321): Another exception was thrown: NoSuchMethodError: The method '<=' was called on null. I/flutter (16321): Another exception was thrown: A RenderFlex overflowed by Infinity pixels on the bottom.

Avalon
  • 56
  • 9
  • Can you please also provide a sample of the code that is causing this issue? – Alex Meuer Dec 06 '18 at 11:48
  • And your pasted error starts with "Another exception"... where is the first one? Start your pasted error with: "══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════" and then the first two errors after that. – scottstoll2017 Dec 06 '18 at 12:12

2 Answers2

1

I'm writing a deep dive on this and an Expanded is not always the answer and when it is, you don't always use it the same way.

Here, if "RenderFlex object was given an infinite size during layout" is the main error then you probably want to use the parent of the Column or Row to restrict its size.

But if one day you find you're dealing with "RenderFlex children have non-zero flex but incoming height constraints are unbounded" then you need to dump the Expanded and swap to a Flexible with fit:FlexFit.loose and then change the Column or Row mainAxisSize to MainAxisSize.min

If the error is "BoxConstraints forces an infinite height (or width)" then you have to consider what axis the error is in. If it's in the mainAxis then you wrap the child in an Expanded, but if it's in the crossAxis then you wrap the Row or Column in an Expanded.

For more help with Flutter be sure to check out Flutter Community on Medium https://medium.com/flutter-community and our live help sessions every Wednesday at https://medium.com/flutter-community/flutterqanda/home

scottstoll2017
  • 1,077
  • 10
  • 14
0

Use 'Expanded' widget

 Expanded( child: new DropdownButtonHideUnderline(
           child: new DropdownButton<String>(
             value: "",hint: new Text("Select"),
             onChanged: (String newValue) {},
             items: bGroops?.map((String value) {
             return DropdownMenuItem<String>(
             value: value,child: Text(value),);})?.toList()) ?? [],
        ))
Anish Manchappillil
  • 697
  • 2
  • 10
  • 19