flutter 3.13 又更新了,與Incorrect use of ParentDataWidget問題
等它更新....要花不少時間,可以去喝杯茶... 但是不要高興太早, 還是一樣遇到問題: 其實flutter並不是表面上看起來那麼簡單,還是跟android or ios 一樣會出現許多隱藏式錯誤. ======== Exception caught by widgets library ======================================================= The following assertion was thrown while applying parent data.: Incorrect use of ParentDataWidget. The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type BoxParentData. Usually, this means that the Expanded widget has the wrong ancestor RenderObjectWidget. Typically, Expanded widgets are placed directly inside Flex widgets. The offending Expanded is currently placed inside a Padding widget. The ownership chain for the RenderObject that received the incompatible parent data was: Column ← Expanded ← Padding ← DecoratedBox ← ConstrainedBox ← Container ← Expanded ← Column ← Semantics ← DefaultTextStyle ← ⋯ solution: 你遇到的錯誤訊息 "Incorrect use of ParentDataWidget" 表示你正