Positioned class
Controls where a child is positioned within a Stack.
Each of left, top, right, bottom is an offset from the corresponding edge of the stack. Use Positioned.fill to stretch to all edges.
- Inheritance
-
- Object
- Widget
- ParentDataWidget<
StackParentData> - Positioned
Constructors
- Positioned({Key? key, int? left, int? top, int? right, int? bottom, int? width, int? height, required Widget child})
-
Creates a Positioned widget with optional offsets from each edge.
const
- Positioned.fill({Key? key, required Widget child})
-
Creates a Positioned that stretches to all four edges of the Stack.
const
Properties
- bottom → int?
-
The offset from the bottom edge of the stack.
final
- child → Widget
-
The child widget whose render object receives the parent data.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int?
-
An explicit height for the child.
final
- key → Key?
-
Controls how one widget replaces another in the tree.
finalinherited
- left → int?
-
The offset from the left edge of the stack.
final
- right → int?
-
The offset from the right edge of the stack.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- top → int?
-
The offset from the top edge of the stack.
final
- width → int?
-
An explicit width for the child.
final
Methods
-
applyParentData(
RenderObject renderObject) → void -
Applies parent data to the given
renderObject.override -
createElement(
) → ParentDataElement -
Creates the Element for this widget.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited