Constraint class
Constructors
Constraint ({ConstraintId ? id , double width = wrapContent , double height = wrapContent , double ? size , @_baseConstraint ConstraintAlign ? left , @_baseConstraint ConstraintAlign ? top , @_baseConstraint ConstraintAlign ? right , @_baseConstraint ConstraintAlign ? bottom , @_baseConstraint ConstraintAlign ? baseline , EdgeInsets clickPadding = EdgeInsets.zero , CLVisibility visibility = visible , bool percentageMargin = false , EdgeInsets margin = EdgeInsets.zero , EdgeInsets goneMargin = EdgeInsets.zero , TextBaseline textBaseline = TextBaseline.alphabetic , int ? zIndex , Offset translate = Offset.zero , bool translateConstraint = false , double widthPercent = 1 , double heightPercent = 1 , PercentageAnchor widthPercentageAnchor = PercentageAnchor.constraint , PercentageAnchor heightPercentageAnchor = PercentageAnchor.constraint , double horizontalBias = 0.5 , double verticalBias = 0.5 , @_wrapperConstraint ConstraintId ? topLeftTo , @_wrapperConstraint ConstraintId ? topCenterTo , @_wrapperConstraint ConstraintId ? topRightTo , @_wrapperConstraint ConstraintId ? centerLeftTo , @_wrapperConstraint ConstraintId ? centerTo , @_wrapperConstraint ConstraintId ? centerRightTo , @_wrapperConstraint ConstraintId ? bottomLeftTo , @_wrapperConstraint ConstraintId ? bottomCenterTo , @_wrapperConstraint ConstraintId ? bottomRightTo , @_wrapperConstraint ConstraintId ? centerHorizontalTo , @_wrapperConstraint ConstraintId ? centerVerticalTo , @_wrapperConstraint ConstraintId ? outTopLeftTo , @_wrapperConstraint ConstraintId ? outTopCenterTo , @_wrapperConstraint ConstraintId ? outTopRightTo , @_wrapperConstraint ConstraintId ? outCenterLeftTo , @_wrapperConstraint ConstraintId ? outCenterRightTo , @_wrapperConstraint ConstraintId ? outBottomLeftTo , @_wrapperConstraint ConstraintId ? outBottomCenterTo , @_wrapperConstraint ConstraintId ? outBottomRightTo , @_wrapperConstraint ConstraintId ? centerTopLeftTo , @_wrapperConstraint ConstraintId ? centerTopCenterTo , @_wrapperConstraint ConstraintId ? centerTopRightTo , @_wrapperConstraint ConstraintId ? centerCenterLeftTo , @_wrapperConstraint ConstraintId ? centerCenterRightTo , @_wrapperConstraint ConstraintId ? centerBottomLeftTo , @_wrapperConstraint ConstraintId ? centerBottomCenterTo , @_wrapperConstraint ConstraintId ? centerBottomRightTo , OnLayoutCallback ? layoutCallback , OnPaintCallback ? paintCallback , bool percentageTranslate = false , double minWidth = 0 , double maxWidth = matchParent , double minHeight = 0 , double maxHeight = matchParent , double ? widthHeightRatio , bool ? ratioBaseOnWidth , int ? eIndex , PinnedInfo ? pinnedInfo , List <ConstraintId > ? anchors , CalcSizeCallback ? calcSizeCallback , CalcOffsetCallback ? calcOffsetCallback })
Properties
anchors
→ List <ConstraintId > ?
For arbitrary position
final
baseline
→ ConstraintAlign ?
final
bottom
→ ConstraintAlign ?
final
bottomCenterTo
→ ConstraintId ?
final
bottomLeftTo
→ ConstraintId ?
final
bottomRightTo
→ ConstraintId ?
final
calcOffsetCallback
→ CalcOffsetCallback ?
final
calcSizeCallback
→ CalcSizeCallback ?
final
centerBottomCenterTo
→ ConstraintId ?
final
centerBottomLeftTo
→ ConstraintId ?
final
centerBottomRightTo
→ ConstraintId ?
final
centerCenterLeftTo
→ ConstraintId ?
final
centerCenterRightTo
→ ConstraintId ?
final
centerHorizontalTo
→ ConstraintId ?
final
centerLeftTo
→ ConstraintId ?
final
centerRightTo
→ ConstraintId ?
final
centerTo
→ ConstraintId ?
final
centerTopCenterTo
→ ConstraintId ?
final
centerTopLeftTo
→ ConstraintId ?
final
centerTopRightTo
→ ConstraintId ?
final
centerVerticalTo
→ ConstraintId ?
final
clickPadding
→ EdgeInsets
Expand the click area without changing the actual size
final
eIndex
→ int ?
When the click areas of child elements overlap, the larger the eIndex, the
priority to respond to the event
final
goneMargin
→ EdgeInsets
final
hashCode
→ int
The hash code for this object.
no setter override
height
→ double
final
heightPercent
→ double
Only takes effect when height is matchConstraint
final
heightPercentageAnchor
→ PercentageAnchor
final
horizontalBias
→ double
Only takes effect if both left and right constraints exist
final
layoutCallback
→ OnLayoutCallback ?
final
left
→ ConstraintAlign ?
These are the base constraints constraint on sibling id or parent
The essence of constraints is alignment
final
margin
→ EdgeInsets
final
maxHeight
→ double
final
maxWidth
→ double
final
minHeight
→ double
Only takes effect when height is wrapContent
final
minWidth
→ double
Only takes effect when width is wrapContent
final
outBottomCenterTo
→ ConstraintId ?
final
outBottomLeftTo
→ ConstraintId ?
final
outBottomRightTo
→ ConstraintId ?
final
outCenterLeftTo
→ ConstraintId ?
final
outCenterRightTo
→ ConstraintId ?
final
outTopCenterTo
→ ConstraintId ?
final
outTopLeftTo
→ ConstraintId ?
final
outTopRightTo
→ ConstraintId ?
final
paintCallback
→ OnPaintCallback ?
final
percentageMargin
→ bool
Both margin and goneMargin can be negative
final
percentageTranslate
→ bool
To offset relative to its own size
final
pinnedInfo
→ PinnedInfo ?
pinned position and traditional layout are mutually exclusive
pinned translate doesn't work when using pinned position
final
ratioBaseOnWidth
→ bool ?
By default, ConstraintLayout will automatically decide which side to base on and
calculate the size of the other side based on widthHeightRatio. But if both sides
are matchConstraint, it cannot be determined automatically. At this point, you need
to specify the ratioBaseOnWidth parameter. The default value of null means automatically decide
final
right
→ ConstraintAlign ?
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
size
→ double ?
When size is non-null, both width and height are set to size
final
textBaseline
→ TextBaseline
When setting baseline alignment, height must be wrap_content or fixed size, other vertical constraints will be illegal.
Warning: Due to a bug in the flutter framework, baseline alignment may not take effect in debug mode
See https:///github.com/flutter/flutter/issues/101179
final
top
→ ConstraintAlign ?
final
topCenterTo
→ ConstraintId ?
final
topLeftTo
→ ConstraintId ?
These are wrapper constraints for simplicity of use, which will eventually convert to base constraints.
final
topRightTo
→ ConstraintId ?
final
translate
→ Offset
final
translateConstraint
→ bool
When translate, whether to translate elements that depend on itself
final
verticalBias
→ double
Only takes effect if both top and bottom constraints exist
final
visibility
→ CLVisibility
final
width
→ double
'wrap_content'、'match_parent'、'match_constraint'、'48, etc'
'match_parent' will be converted to the base constraints
final
widthHeightRatio
→ double ?
Only takes effect if the size of one side is matchConstraint and the size of the other side can be
inferred (fixed size, matchParent, matchConstraint with two constraints)
final
widthPercent
→ double
Only takes effect when width is matchConstraint
final
widthPercentageAnchor
→ PercentageAnchor
final
zIndex
→ int ?
final
Methods
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited
flutter_constraintlayout 1.7.0-stable