applyConstraint method
Widget
applyConstraint({
- ConstraintId? id,
- double width = wrapContent,
- double height = wrapContent,
- double? size,
- ConstraintAlign? left,
- ConstraintAlign? top,
- ConstraintAlign? right,
- ConstraintAlign? bottom,
- 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,
- ConstraintId? topLeftTo,
- ConstraintId? topCenterTo,
- ConstraintId? topRightTo,
- ConstraintId? centerLeftTo,
- ConstraintId? centerTo,
- ConstraintId? centerRightTo,
- ConstraintId? bottomLeftTo,
- ConstraintId? bottomCenterTo,
- ConstraintId? bottomRightTo,
- ConstraintId? centerHorizontalTo,
- ConstraintId? centerVerticalTo,
- ConstraintId? outTopLeftTo,
- ConstraintId? outTopCenterTo,
- ConstraintId? outTopRightTo,
- ConstraintId? outCenterLeftTo,
- ConstraintId? outCenterRightTo,
- ConstraintId? outBottomLeftTo,
- ConstraintId? outBottomCenterTo,
- ConstraintId? outBottomRightTo,
- ConstraintId? centerTopLeftTo,
- ConstraintId? centerTopCenterTo,
- ConstraintId? centerTopRightTo,
- ConstraintId? centerCenterLeftTo,
- ConstraintId? centerCenterRightTo,
- ConstraintId? centerBottomLeftTo,
- ConstraintId? centerBottomCenterTo,
- ConstraintId? centerBottomRightTo,
- OnLayoutCallback? layoutCallback,
- OnPaintCallback? paintCallback,
- double chainWeight = 1,
- 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,
Implementation
Widget applyConstraint({
ConstraintId? id,
double width = wrapContent,
double height = wrapContent,
double? size,
ConstraintAlign? left,
ConstraintAlign? top,
ConstraintAlign? right,
ConstraintAlign? bottom,
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, // default is child index
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,
ConstraintId? topLeftTo,
ConstraintId? topCenterTo,
ConstraintId? topRightTo,
ConstraintId? centerLeftTo,
ConstraintId? centerTo,
ConstraintId? centerRightTo,
ConstraintId? bottomLeftTo,
ConstraintId? bottomCenterTo,
ConstraintId? bottomRightTo,
ConstraintId? centerHorizontalTo,
ConstraintId? centerVerticalTo,
ConstraintId? outTopLeftTo,
ConstraintId? outTopCenterTo,
ConstraintId? outTopRightTo,
ConstraintId? outCenterLeftTo,
ConstraintId? outCenterRightTo,
ConstraintId? outBottomLeftTo,
ConstraintId? outBottomCenterTo,
ConstraintId? outBottomRightTo,
ConstraintId? centerTopLeftTo,
ConstraintId? centerTopCenterTo,
ConstraintId? centerTopRightTo,
ConstraintId? centerCenterLeftTo,
ConstraintId? centerCenterRightTo,
ConstraintId? centerBottomLeftTo,
ConstraintId? centerBottomCenterTo,
ConstraintId? centerBottomRightTo,
OnLayoutCallback? layoutCallback,
OnPaintCallback? paintCallback,
double chainWeight = 1,
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,
}) {
return Constrained(
key: key,
constraint: Constraint(
id: id,
width: width,
height: height,
size: size,
left: left,
top: top,
right: right,
bottom: bottom,
baseline: baseline,
clickPadding: clickPadding,
visibility: visibility,
percentageMargin: percentageMargin,
margin: margin,
goneMargin: goneMargin,
textBaseline: textBaseline,
zIndex: zIndex,
translate: translate,
translateConstraint: translateConstraint,
widthPercent: widthPercent,
heightPercent: heightPercent,
widthPercentageAnchor: widthPercentageAnchor,
heightPercentageAnchor: heightPercentageAnchor,
horizontalBias: horizontalBias,
verticalBias: verticalBias,
topLeftTo: topLeftTo,
topCenterTo: topCenterTo,
topRightTo: topRightTo,
centerLeftTo: centerLeftTo,
centerTo: centerTo,
centerRightTo: centerRightTo,
bottomLeftTo: bottomLeftTo,
bottomCenterTo: bottomCenterTo,
bottomRightTo: bottomRightTo,
centerHorizontalTo: centerHorizontalTo,
centerVerticalTo: centerVerticalTo,
layoutCallback: layoutCallback,
paintCallback: paintCallback,
percentageTranslate: percentageTranslate,
minWidth: minWidth,
maxWidth: maxWidth,
minHeight: minHeight,
maxHeight: maxHeight,
widthHeightRatio: widthHeightRatio,
ratioBaseOnWidth: ratioBaseOnWidth,
outTopLeftTo: outTopLeftTo,
outTopCenterTo: outTopCenterTo,
outTopRightTo: outTopRightTo,
outCenterLeftTo: outCenterLeftTo,
outCenterRightTo: outCenterRightTo,
outBottomLeftTo: outBottomLeftTo,
outBottomCenterTo: outBottomCenterTo,
outBottomRightTo: outBottomRightTo,
centerTopLeftTo: centerTopLeftTo,
centerTopCenterTo: centerTopCenterTo,
centerTopRightTo: centerTopRightTo,
centerCenterLeftTo: centerCenterLeftTo,
centerCenterRightTo: centerCenterRightTo,
centerBottomLeftTo: centerBottomLeftTo,
centerBottomCenterTo: centerBottomCenterTo,
centerBottomRightTo: centerBottomRightTo,
eIndex: eIndex,
pinnedInfo: pinnedInfo,
anchors: anchors,
calcSizeCallback: calcSizeCallback,
calcOffsetCallback: calcOffsetCallback,
),
child: this,
).enter();
}