日常Flutter

Incorrect use of ParentDataWidge

2022-08-23  本文已影响0人  三千烦恼风_eefa

报错信息:

The ParentDataWidget Positioned(left: 11.5, top: 0.0, right: 7.7, bottom: 227.4) wants to apply ParentData of type StackParentData to a RenderObject, which has been set up to accept ParentData of incompatible type FlexParentData.

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 Column widget.

The ownership chain for the RenderObject that received the incompatible parent data was:
ConstrainedBox ← Container ← GMic2SingLyricWidget ← Positioned ← PositionedTransition ← Column ← Padding ← ConstrainedBox ← Container ← GMic2SingWidget ← ⋯

解决方案:

image.png
上一篇下一篇

猜你喜欢

热点阅读