Flexible class
A widget that controls how a child of a Row, Column, or Flex flexes.
用于控制
Row
、Column
、Flex
子控件的控件。
Using a Flexible widget gives a child of a Row, Column, or Flex the flexibility to expand to fill the available space in the main axis (e.g., horizontally for a Row or vertically for a Column), but, unlike Expanded, Flexibledoes not require the child to fill the available space.
Flexible控件可以使一个
Row
、Column
、Flex
子控件提供扩展的灵活性,以填充主轴上的可用空间(例如,水平方向上的Row
或者垂直方向上的Column
)。但是与Expanded
不同的是,Flexible
不会要求子控件填充可用空间
A Flexible widget must be a descendant of a Row, Column, or Flex, and the path from the Flexible widget to its enclosing Row, Column, or Flex must contain only StatelessWidgets or StatefulWidgets (not other kinds of widgets, like RenderObjectWidgets).
Flexible
必须是Row
、Column
、Flex
的子控件,Flexible与装入它的Row
、Column
、Flex
控件之间,只能是StatelessWidget
或者StatefulWidget
(不能是别的类型,比如RenderObjectWidget
)。
See also:
-
Expanded, which forces the child to expand to fill the available space.
-
Spacer, a widget that takes up space proportional to it’s flex value.
-
Inheritance
Object->Diagnosticable-> DiagnosticableTree ->Widget ->ProxyWidget->ParentDataWidget<Flex>-> Flexible
-
Implementers