728x90
반응형
flutter에서 해당 에러가 발생했다면,
======== Exception caught by widgets library =======================================================
The following assertion was thrown while applying parent data.:
Incorrect use of ParentDataWidget.
The ParentDataWidget Positioned(top: 0.0, bottom: 0.0, width: 192.0) wants to apply ParentData of type StackParentData to a RenderObject, which has been set up to accept ParentData of incompatible type ParentData.
Usually, this means that the Positioned widget has the wrong ancestor RenderObjectWidget. Typically, Positioned widgets are placed directly inside Stack widgets.
The offending Positioned is currently placed inside a Transform widget.
The ownership chain for the RenderObject that received the incompatible parent data was:
ColoredBox ← Container ← Positioned ← Transform ← Container ← AnimatedContainer ← Stack ← KeyedSubtree-[GlobalKey#8b22c] ← _BodyBuilder ← MediaQuery ← ⋯
before
Positioned(
top: 0,
bottom: 0,
width: menuWidth,
child: Container(
color: Colors.yellow,
),
)
after
Stack(
children: [
Positioned(
top: 0,
bottom: 0,
width: menuWidth,
child: Container(
color: Colors.yellow,
),
),
],
)
positioned 위젯은 stack으로 감싸줘야한다.
728x90
반응형
'Flutter' 카테고리의 다른 글
[j Flutter] text 눌렀을 때 copy 복사하기 (0) | 2023.10.18 |
---|---|
[j Flutter] TextField 숫자만 입력받기 (0) | 2023.08.01 |
[j Flutter] pageview indicator 추가하기 (0) | 2023.01.26 |
[j Flutter] Currency Text Input Formatter 사용해 화폐단위 사용 및 콤마 찍어주기 (0) | 2023.01.26 |
[j Flutter] TextFormField 커서 맨 뒤로 보내기 (0) | 2023.01.20 |