본문 바로가기

Flutter

[j Flutter] Vertical viewport was given unbounded height 에러 처리

728x90
반응형

Vertical viewport was given unbounded height 에러가 났을 때 처리

 

before

 ListView(
        children: restaurantModel.row_search_result.map((e) {
          return RestaurantListTile(e);
        }).toList(),
      )

 

after

 ListView(
        scrollDirection: Axis.vertical,
        shrinkWrap: true,
        children: restaurantModel.row_search_result.map((e) {
          return RestaurantListTile(e);
        }).toList(),
      )

 

listview 속성에 아래 코드를 추가해준다.

 scrollDirection: Axis.vertical,
 shrinkWrap: true,

 

728x90
반응형