StacPositioned class
A Stac widget that controls where a child of a Stack is positioned.
This widget corresponds to Flutter's Positioned widget and allows precise positioning of a widget within a Stack using coordinates and optional sizing constraints.
{@tool snippet} Dart Example:
const StacPositioned(
left: 10,
top: 20,
child: StacText(data: 'Positioned text'),
)
{@end-tool}
{@tool snippet} JSON Example:
{
"type": "positioned",
"left": 10,
"top": 20,
"child": {"type": "text", "data": "Positioned text"}
}
{@end-tool}
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacPositioned
- Annotations
-
- @JsonSerializable()
Constructors
- StacPositioned.new({double? left, double? top, double? right, double? bottom, double? width, double? height, required StacWidget? child})
-
Creates a positioned widget with optional positioning and sizing.
const
-
StacPositioned.fromJson(Map<
String, dynamic> json) -
Creates a StacPositioned from a JSON map.
factory
Properties
- bottom → double?
-
The distance from the bottom edge of the stack.
final
- child → StacWidget?
-
The widget to position within the stack.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
The height of the positioned widget.
final
-
jsonData
→ Map<
String, dynamic> ? -
Raw JSON data for this widget
finalinherited
- left → double?
-
The distance from the left edge of the stack.
final
- right → double?
-
The distance from the right edge of the stack.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- top → double?
-
The distance from the top edge of the stack.
final
- type → String
-
The type of the widget
no setteroverride
- width → double?
-
The width of the positioned widget.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this widget to a JSON map
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited