`Row` 내부에서 ListTile을 렌더링 할 때`Failed assertion : line 1687 pos 12 : 'hasSize'` 오류가 발생합니다.

조이 자오

나는 플러터 코드 아래에 있습니다.

Widget build(BuildContext context) {
    return Center(
      child: Card(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Row(
              children: <Widget>[
                SizedBox(
                    height: 100,
                    child: ListTile(
                      leading: IconButton(
                        iconSize: 30,
                        icon: roundImage(post.userPicture, Icon(Icons.person)),
                        onPressed: () {},
                      ),
                      subtitle: Text(this.post.message),
                    )),
              ],
            ),
          ],
        ),
      ),
    );
  }

하지만이 오류가 발생합니다.

════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderPhysicalShape#7713c relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1687 pos 12: 'hasSize'
The relevant error-causing widget was
    Card 

내가 추가 한 SizedBoxRow하지만 여전히 불평 hasSize오류입니다. 이 문제를 어떻게 해결할 수 있습니까?

Dhanasekar

달성하려는 것이 명확하지 않지만 사용하는 대신 SizedBox내부 Expanded또는 Flexible위젯을 래핑 할 수 있습니다.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

Related 관련 기사

뜨겁다태그

보관