inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

(어찌저찌 해결되긴 하는데..) AppBar의 bottom에 PreferredSize 적용 시 기존 TabBar는 잘 되는데 Row로 감싸면 에러가 떠요.

미해결

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

코드팩토리 디스코드에 질문하면 더욱 빠르게 질문을 받아 볼 수 있습니다! [코드팩토리 디스코드] https://bit.ly/3HzRzUM - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 269. TabBar 스타일링하기 [TabBar Widget] 이론 섹션의 269번 강의 영상에서 약 9:46 부터 나오는 PreferredSize 의 child 속성을 일반 위젯인 Row 로 wrapping한 경우에요. 문제의 에러 코드 Widget build(BuildContext context) { return DefaultTabController( length: TABS.length, child: Scaffold( backgroundColor: Colors.pink[50], appBar: AppBar( title: Text('Basic AppBar'), backgroundColor: Colors.green[300], bottom: PreferredSize( preferredSize: Size.fromHeight(80), child: TabBar( // 내부 사항 생략 ), ), ), body: TabBarView( children: TABS.map((e) => Center(child: Icon(e.icon))).toList(), ), ), ); } 위 코드는 그대로 실행이 잘 되지만 이 상태에서 TabBar 에 커서를 두고 Context Action 을 실행해서 Row 로 감싸기를 하면 이런 에러가 떠요. child: Row( children: [ child: TabBar( // 내부 사항 생략 ), ], ), RenderFlex children have non-zero flex but incoming width constraints are unbounded. The affected RenderFlex is: _TabLabelBarRenderer#be04c relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE parentData: <none> (can use size) constraints: BoxConstraints(unconstrained) size: MISSING direction: horizontal mainAxisAlignment: start mainAxisSize: max crossAxisAlignment: center textDirection: ltr verticalDirection: down spacing: 0.0 The creator information is set to: _TabLabelBar ← IconTheme ← Builder ← DefaultTextStyle ← _TabStyle ← CustomPaint ← Semantics ← MediaQuery ← TabBar ← Row ← PreferredSize ← Column ← ⋯ The nearest ancestor providing an unbounded width constraint is: RenderFlex#01f78 relayoutBoundary=up10 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE The relevant error-causing widget was: TabBar TabBar:file:{Project Root Dir}/lib/screen/basic_appbar_tabbar_screen.dart:22:17 에러 스택 따라가다 보니 해결됨 Row 로 감싸진 TabBar 를 다시 Expanded 로 감싸면 해결이 돼요. 그래도 간헐적으로 픽셀 오버플로우 에러가 나기는 하는데 어쨌든 사이즈 미확인 문제는 해결된 것 같아요. child: Row( children: [ Expanded( child: TabBar( // 내부 사항 생략 ), ), ], ), 근데 아직 왜 TabBar 에 사이즈 제한 을 걸지 않으면 Row 로 감쌀 수 없는지 잘 모르겠어요. 자세히 알려주시면 감사합니다.

  • flutter
  • 클론코딩
  • tabbar
  • appbar
Ryu 댓글 3 좋아요 0 조회수 81

Appbar의 Tabbar를 누르면 다른 dart파일의 내용을 불러오고 싶어요

미해결

Flutter 초급 - Http통신, 상태관리

Appbar의 Tabbar를 누르면 다른 dart파일의 내용을 불러오고 싶어요 body : TabBarView ( children : [ // 첫번째 페이지 인사말 페이지 (home_page) home_page (), Icon ( Icons . show_chart_rounded ), Icon ( Icons . contact_page_rounded ), Icon ( Icons . contact_page_rounded ), 이렇게만 하면 home_page.dart 파일의 내용을 불러올수가 없더라구요... 각가의 탭을 눌렀을때 어떻게 해야 다른 다트 파일의 내용을 불러올 수 있나요??

  • appbar
  • ios
  • tabbar
  • android
  • 웹앱
  • Flutter
지기선 댓글 1 좋아요 0 조회수 376

인기 태그

인프런 TOP Writers

주간 인기글