flutter_constraintlayout library Null safety

Classes

Anchor
Barrier
BarrierDefine
Constrained
Each child element needs to be wrapped with Constrained to declare constraint information
ConstrainedNode
All child elements and helper widgets will be converted to ConstrainedNode before layout
Constraint
ConstraintAlign
ConstraintBoxData
ConstraintDefine
ConstraintId
Each child element can be set with an id so that they can be referenced by other child elements. If not set, other child elements can be referenced by relative id. But once an id is defined, it cannot be referenced using a relative id.
ConstraintLayout
A super powerful Stack, build flexible layouts with constraints. Similar to ConstraintLayout for Android and AutoLayout for iOS. But the code implementation is much more efficient, it has O(n) layout time complexity and no linear equation solving is required.
ConstraintLayoutController
Guideline
GuidelineDefine
IndexConstraintId
A relative id type that refers to a child element by its index
MultiChildWidgetContext
Provide open grammar
OffBuildWidget
For performance optimization
PinnedInfo
PinnedTranslate
Has no effect in pinned position layout mode. You can use it to do the rotation of child elements.
RelativeConstraintId
A relative id type that is referenced by index offsets between child elements
UnConstrained
For constraints and widgets separation

Extensions

ConstrainedWidgetExt
For easy use
ConstraintLayoutExt
Provide open grammar
MultiChildWidgetChildExt
Provide open grammar

Constants

gone → const CLVisibility
CLVisibility.gone
invisible → const CLVisibility
CLVisibility.invisible
matchConstraint → const double
-3.1415926
matchParent → const double
-2.7182818
visible → const CLVisibility
CLVisibility.visible
wrapContent → const double
-0.6180339

Properties

parent ConstraintId
final

Functions

cId(String id) ConstraintId
circleTranslate({required double radius, required double angle}) Offset
For circle position
constraintGrid({required ConstraintId id, required ConstraintAlign left, required ConstraintAlign top, required int itemCount, required int columnCount, double? itemWidth, double? itemHeight, double? itemSize, Size itemSizeBuilder(int index, int rowIndex, int columnIndex)?, required Widget itemBuilder(int index, int rowIndex, int columnIndex), EdgeInsets itemMarginBuilder(int index, int rowIndex, int columnIndex)?, int itemSpanBuilder(int index)?, EdgeInsets margin = EdgeInsets.zero, CLVisibility visibility = visible, Offset translate = Offset.zero, bool translateConstraint = false, int? zIndex}) List<Widget>
For list、grid、staggered grid
rId(int childIndex) ConstraintId
sId(int siblingIndexOffset) ConstraintId

Enums

AnchorType
For pinned position and translate
BarrierDirection
CLVisibility
ConstraintAlignType
PercentageAnchor
For percentage layout

Typedefs

CalcOffsetCallback = Offset Function(RenderBox parent, ConstrainedNode self, List<ConstrainedNode> anchors)
CalcSizeCallback = BoxConstraints Function(RenderBox parent, List<ConstrainedNode> anchors)
OnLayoutCallback = void Function(RenderBox renderBox, Rect rect)
OnPaintCallback = void Function(RenderBox renderBox, Offset offset, Size size, Offset? anchorPoint, double? angle)