Widget image(String url) {
return Image.network(
url,
fit: BoxFit.fitHeight,
);
}
, Reloaded 1 of 1245 libraries in 509ms (compile: 22 ms, reload: 175 ms, reassemble: 250 ms).
Reloaded 1 of 1245 libraries in 540ms (compile: 24 ms, reload: 186 ms, reassemble: 260 ms).
Reloaded 1 of 1245 libraries in 508ms (compile: 22 ms, reload: 184 ms, reassemble: 231 ms).
Reloaded 1 of 1245 libraries in 496ms (compile: 21 ms, reload: 182 ms, reassemble: 225 ms).
════════ Exception caught by rendering library ═════════════════════════════════
The following assertion was thrown during performResize():
Vertical viewport was given unbounded height.
Viewports expand in the scrolling direction to fill their container. In this case, a vertical viewport was given an unlimited amount of vertical space in which to expand. This situation typically happens when a scrollable widget is nested inside another scrollable widget.
If this widget is always nested in a scrollable widget there is no need to use a viewport because there will always be enough vertical space for the children. In this case, consider using a Column or Wrap instead. Otherwise, consider using a CustomScrollView to concatenate arbitrary slivers into a single scrollable.
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
The following RenderObject was being processed when the exception was fired: RenderViewport#39650 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
needs compositing
parentData: (can use size)
constraints: BoxConstraints(0.0<=w<=358.0, 0.0<=h<=Infinity)
size: MISSING
axisDirection: down
crossAxisDirection: right
offset: ScrollPositionWithSingleContext#5c0a5(offset: 0.0, range: null..null, viewport: null, ScrollableState, AlwaysScrollableScrollPhysics -> ClampingScrollPhysics -> RangeMaintainingScrollPhysics, IdleScrollActivity#c310b, ScrollDirection.idle)
anchor: 0.0
center child: RenderSliverPadding#567ad NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: paintOffset=Offset(0.0, 0.0)
constraints: MISSING
geometry: null
padding: EdgeInsets(0.0, 24.0, 0.0, 0.0)
textDirection: ltr
child: RenderSliverGrid#d8c42 NEEDS-LAYOUT NEEDS-PAINT
parentData: paintOffset=Offset(0.0, 0.0)
constraints: MISSING
geometry: null
no children current live
RenderObject: RenderViewport#39650 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
needs compositing
parentData: (can use size)
constraints: BoxConstraints(0.0<=w<=358.0, 0.0<=h<=Infinity)
size: MISSING
axisDirection: down
crossAxisDirection: right
offset: ScrollPositionWithSingleContext#5c0a5(offset: 0.0, range: null..null, viewport: null, ScrollableState, AlwaysScrollableScrollPhysics -> ClampingScrollPhysics -> RangeMaintainingScrollPhysics, IdleScrollActivity#c310b, ScrollDirection.idle)
anchor: 0.0
center child: RenderSliverPadding#567ad NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: paintOffset=Offset(0.0, 0.0)
constraints: MISSING
geometry: null
padding: EdgeInsets(0.0, 24.0, 0.0, 0.0)
textDirection: ltr
child: RenderSliverGrid#d8c42 NEEDS-LAYOUT NEEDS-PAINT
parentData: paintOffset=Offset(0.0, 0.0)
constraints: MISSING
geometry: null
no children current live
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderViewport#39650 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderViewport#39650 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderIgnorePointer#b43b9 relayoutBoundary=up9 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderSemanticsAnnotations#61afc relayoutBoundary=up8 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderPointerListener#6b404 relayoutBoundary=up7 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderSemanticsGestureHandler#ae397 relayoutBoundary=up6 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderPointerListener#6fb95 relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: _RenderScrollSemantics#7a472 relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderClipRect#96b38 relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
Column Column:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:220:27
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderFlex#cf64e relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
Stack Stack:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:218:30
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
Reloaded 1 of 1245 libraries in 739ms (compile: 37 ms, reload: 186 ms, reassemble: 448 ms).
════════ Exception caught by gestures library ══════════════════════════════════
Cannot hit test a render box with no size.
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by gestures library ══════════════════════════════════
Cannot hit test a render box with no size.
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
The following assertion was thrown during performResize():
Vertical viewport was given unbounded height.
Viewports expand in the scrolling direction to fill their container. In this case, a vertical viewport was given an unlimited amount of vertical space in which to expand. This situation typically happens when a scrollable widget is nested inside another scrollable widget.
If this widget is always nested in a scrollable widget there is no need to use a viewport because there will always be enough vertical space for the children. In this case, consider using a Column or Wrap instead. Otherwise, consider using a CustomScrollView to concatenate arbitrary slivers into a single scrollable.
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
The following RenderObject was being processed when the exception was fired: RenderViewport#39650 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
needs compositing
parentData: (can use size)
constraints: BoxConstraints(0.0<=w<=358.0, 0.0<=h<=Infinity)
size: MISSING
axisDirection: down
crossAxisDirection: right
offset: ScrollPositionWithSingleContext#5c0a5(offset: 0.0, range: null..null, viewport: null, ScrollableState, AlwaysScrollableScrollPhysics -> ClampingScrollPhysics -> RangeMaintainingScrollPhysics, IdleScrollActivity#c310b, ScrollDirection.idle)
anchor: 0.0
center child: RenderSliverPadding#567ad NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: paintOffset=Offset(0.0, 0.0)
constraints: MISSING
geometry: null
padding: EdgeInsets(0.0, 24.0, 0.0, 0.0)
textDirection: ltr
child: RenderSliverGrid#d8c42 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: paintOffset=Offset(0.0, 0.0)
constraints: MISSING
geometry: null
no children current live
RenderObject: RenderViewport#39650 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
needs compositing
parentData: (can use size)
constraints: BoxConstraints(0.0<=w<=358.0, 0.0<=h<=Infinity)
size: MISSING
axisDirection: down
crossAxisDirection: right
offset: ScrollPositionWithSingleContext#5c0a5(offset: 0.0, range: null..null, viewport: null, ScrollableState, AlwaysScrollableScrollPhysics -> ClampingScrollPhysics -> RangeMaintainingScrollPhysics, IdleScrollActivity#c310b, ScrollDirection.idle)
anchor: 0.0
center child: RenderSliverPadding#567ad NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: paintOffset=Offset(0.0, 0.0)
constraints: MISSING
geometry: null
padding: EdgeInsets(0.0, 24.0, 0.0, 0.0)
textDirection: ltr
child: RenderSliverGrid#d8c42 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: paintOffset=Offset(0.0, 0.0)
constraints: MISSING
geometry: null
no children current live
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderViewport#39650 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderViewport#39650 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderIgnorePointer#b43b9 relayoutBoundary=up9 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderSemanticsAnnotations#61afc relayoutBoundary=up8 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderPointerListener#6b404 relayoutBoundary=up7 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderSemanticsGestureHandler#ae397 relayoutBoundary=up6 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderPointerListener#6fb95 relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: _RenderScrollSemantics#7a472 relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderClipRect#96b38 relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
Column Column:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:220:27
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderFlex#cf64e relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
Stack Stack:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:218:30
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
Reloaded 1 of 1245 libraries in 656ms (compile: 21 ms, reload: 181 ms, reassemble: 386 ms).
════════ Exception caught by gestures library ══════════════════════════════════
Cannot hit test a render box with no size.
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by gestures library ══════════════════════════════════
Cannot hit test a render box with no size.
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by gestures library ══════════════════════════════════
Cannot hit test a render box with no size.
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by gestures library ══════════════════════════════════
Cannot hit test a render box with no size.
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderTransform#02407 relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2164 pos 12: 'hasSize'
The relevant error-causing widget was:
GridView GridView:file:///C:/Users/DELL/clean%20Articucture/learning/lib/Presentation/Screens/home_screen.dart:231:40
════════════════════════════════════════════════════════════════════════════════
The error you're encountering stems from placing a scrollable widget (like GridView) inside another scrollable widget without properly constraining their sizes. In your case, the GridView.builder is nested within a Column which is inside a Container with a fixed height, but the GridView doesn't have an explicit height constraint. This leads to the GridView attempting to expand infinitely in the vertical direction, causing the error:
Vertical viewport was given unbounded height.
To resolve this issue, you need to provide a bounded height to the GridView. There are several ways to achieve this:
Wrap the GridView with an Expanded or Flexible widget: This tells Flutter to fill the available space within the parent widget (in this case, the Column inside the Container that already has a fixed height).
Wrap the GridView with a SizedBox and specify the height: This directly provides a fixed height to the GridView.
Set shrinkWrap: true and provide a non-scrolling physics: This constrains the GridView to only occupy the space it needs and disables its scrolling behavior.
Below, I'll illustrate each of these solutions and explain how you can implement them in your code.
Option 1: Use Expanded
Wrap the GridView.builder with an Expanded widget. This will give it a bounded height within the Column which is itself inside a Container with a fixed height (containerHeight).
Option 3: Set shrinkWrap: true and Disable Scrolling
By setting shrinkWrap: true, you tell the GridView to take only as much space as it needs, instead of expanding to fill infinite space. Additionally, by setting physics: NeverScrollableScrollPhysics(), you disable the scrolling behavior of the GridView, preventing conflicts with any parent scrollable widgets.
The error occurs because the GridView tries to expand infinitely in the vertical direction when placed inside a Column without a bounded height. Flutter needs to know how much space to allocate for the GridView, and without constraints, it cannot layout the widgets properly.
From the error message:
Vertical viewport was given unbounded height.
This situation typically happens when a scrollable widget is nested inside another scrollable widget.
In your code, the GridView is nested within a Column, and the Column itself is within a Container with a fixed height. However, the GridView doesn't know how much vertical space it can take, leading to the unbounded height issue.
Why These Solutions Work
Using Expanded or Flexible: These widgets tell Flutter to fill the available space within a Column or Row. By wrapping the GridView with Expanded, you give it a specific height constraint, allowing Flutter to calculate the layout.
Using SizedBox: This provides a fixed height to the GridView, making its size bounded.
Using shrinkWrap: true and disabling scrolling: This tells the GridView to only take as much vertical space as necessary to display its children and not more. Disabling scrolling ensures that it doesn't conflict with any parent scrollable widgets like SingleChildScrollView or CustomScrollView.
Choose the Best Option
Depending on your UI requirements:
If you want the GridView to take up the remaining space within the parent Container, Option 1 is suitable.
If you know the exact height you want for the GridView, or you have a fixed number of items, Option 2 works well.
If the GridView content isn't expected to overflow and you prefer not to have it scroll independently, Option 3 is appropriate.
Applying the Solution to Your Code
Here's how you can modify your code using Option 1:
Avoid Nesting Scrollable Widgets: Try to minimize nesting scrollable widgets within each other as it can lead to unexpected behaviors and performance issues.
Use CustomScrollView and Slivers: If you need multiple scrollable areas working together, consider using CustomScrollView with slivers like SliverGrid and SliverList.
Test on Different Screen Sizes: Ensure that your UI behaves as expected on various screen sizes and orientations.
By adjusting your widget tree to provide bounded constraints to the GridView, you should resolve the rendering exceptions you're encountering. If you continue to experience issues, please double-check that no other scrollable widgets are causing similar unbounded constraints and consider refactoring your layout accordingly.