positioned method
Widget
positioned({
- PositionUnit? top,
- PositionUnit? left,
- PositionUnit? bottom,
- PositionUnit? right,
- Key? key,
Positions the widget using multiple edge offsets simultaneously.
This is a convenience method that allows setting top, left, bottom, and right positions in a single call. Any combination of edges can be specified.
Example:
Container().positioned(
top: 10.position,
left: 20.position,
),
Container().positioned(
bottom: 0.position,
right: 0.position,
),
Implementation
Widget positioned({
PositionUnit? top,
PositionUnit? left,
PositionUnit? bottom,
PositionUnit? right,
Key? key,
}) {
return _WidgetWrapper._wrapOrCopyWith(
child: this,
key: key != null ? () => key : null,
top: top != null ? () => top : null,
left: left != null ? () => left : null,
bottom: bottom != null ? () => bottom : null,
right: right != null ? () => right : null,
);
}