position method
Positions this widget within its parent Stack widget.
Implementation
@widgetFactory
Widget position({
double? start,
double? end,
double? left,
double? right,
double? top,
double? bottom,
double? height,
double? width,
bool? fill,
Rect? rect,
RelativeRect? relativeRect,
}) {
assert(() {
_debugCheckParameterCombinations(modifier: 'position', [
{'start': start, 'end': end},
{'left': left, 'right': right},
]);
_debugCheckParameterCombinations(modifier: 'position', [
{
'start': start,
'end': end,
'left': left,
'right': right,
'top': top,
'bottom': bottom,
'height': height,
'width': width,
'fill': fill,
},
{'rect': rect},
{'relativeRect': relativeRect},
]);
return true;
}());
if (rect != null) {
return FleetPositioned.fromRect(
rect: rect,
child: this,
);
} else if (relativeRect != null) {
return FleetPositioned.fromRelativeRect(
rect: relativeRect,
child: this,
);
} else {
if (fill ?? false) {
top ??= 0;
bottom ??= 0;
}
if (start != null || end != null) {
if (fill ?? false) {
start ??= 0;
end ??= 0;
}
return FleetPositionedDirectional(
start: start,
end: end,
top: top,
bottom: bottom,
height: height,
width: width,
child: this,
);
} else {
if (fill ?? false) {
left ??= 0;
right ??= 0;
}
return FleetPositioned(
left: left,
top: top,
right: right,
bottom: bottom,
height: height,
width: width,
child: this,
);
}
}
}