Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter app error -- RenderBox was not laid out: RenderFlex#0bf43 relayoutBoundary=up6 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE

Tags:

flutter

Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderFlex#0bf43 relayoutBoundary=up6 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1687 pos 12: 'hasSize'
The relevant error-causing widget was
    Padding 
lib\Reset.dart:18
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderPadding#0b7cf relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1687 pos 12: 'hasSize'
The relevant error-causing widget was
    ListView 
lib\Reset.dart:15
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderRepaintBoundary#393f1 relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1687 pos 12: 'hasSize'
The relevant error-causing widget was
    ListView 
lib\Reset.dart:15
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
'package:flutter/src/rendering/sliver_multi_box_adaptor.dart': Failed assertion: line 549 pos 12: 'child.hasSize': is not true.
The relevant error-causing widget was
    ListView 
lib\Reset.dart:15
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
The getter 'scrollOffsetCorrection' was called on null.
Receiver: null
Tried calling: scrollOffsetCorrection
The relevant error-causing widget was
    ListView 
lib\Reset.dart:15
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════

Code Screenshot

This is my code, when I run it, it show these error above, and the screen goes white. How can I correctly resolve this issue? Run Device screenshot

like image 440
Bowen Shen Avatar asked Jan 22 '20 16:01

Bowen Shen


1 Answers

Try wrapping your parent widget in Expanded() or add shrinkWrap: true before your ListView builder

like image 199
van Avatar answered Oct 23 '22 02:10

van