[flutter/error] Vertical viewport was given unbounded heightperformResize()

💜Dabo (개발자 다보)·2020년 4월 22일
0

Code

return Column(
      children: <Widget>[
        Text('title'),
        ListView(
          children: _selectedEvents.map(_buildEventDetailCard)?.toList(),
        ),
      ],
    );

Error Message

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 instead. Otherwise, consider using the "shrinkWrap" property (or a ShrinkWrappingViewport) to size the height of the viewport to the sum of the heights of its children.

The relevant error-causing widget was

════════ Exception caught by rendering library ═════════════════════════════════
The method '>' was called on null.
Receiver: null
Tried calling: >(1e-10)
The relevant error-causing widget was
    Column 
════════════════════════════════════════════════════════════════════════════════

Solution Code

addshrinkWrap: true :)

return Column(
      children: <Widget>[
        Text('title'),
        shrinkWrap: true,
        ListView(
          children: _selectedEvents.map(_buildEventDetailCard)?.toList(),
        ),
      ],
    );
profile
𝙸 𝚊𝚖 𝚊 𝚌𝚞𝚛𝚒𝚘𝚞𝚜 𝚍𝚎𝚟𝚎𝚕𝚘𝚙𝚎𝚛 𝚠𝚑𝚘 𝚎𝚗𝚓𝚘𝚢𝚜 𝚍𝚎𝚏𝚒𝚗𝚒𝚗𝚐 𝚊 𝚙𝚛𝚘𝚋𝚕𝚎𝚖. 🇰🇷👩🏻‍💻

0개의 댓글