StacAlign class
A Stac model representing Flutter's Align
widget.
Aligns its child within itself and optionally sizes itself based on the child's size. Supports alignment, width factor, and height factor properties.
StacAlign(
alignment: StacAlignmentDirectional.center,
widthFactor: 0.8,
heightFactor: 0.6,
child: StacText(data: 'Centered'),
)
{
"type": "align",
"alignment": "center",
"widthFactor": 0.8,
"heightFactor": 0.6,
"child": {"type": "text", "data": "Centered"}
}
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacAlign
- Annotations
-
- @JsonSerializable()
Constructors
- StacAlign.new({StacAlignmentDirectional? alignment, double? widthFactor, double? heightFactor, StacWidget? child})
-
Creates a StacAlign with optional alignment and sizing properties.
const
-
StacAlign.fromJson(Map<
String, dynamic> json) -
Creates a StacAlign from JSON.
factory
Properties
- alignment → StacAlignmentDirectional?
-
How to align the child within the align widget.
final
- child → StacWidget?
-
The child widget to align.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- heightFactor → double?
-
If non-null, sets the height of this widget to the child's height
multiplied by this factor.
final
-
jsonData
→ Map<
String, dynamic> ? -
Raw JSON data for this widget
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
Widget type identifier.
no setteroverride
- widthFactor → double?
-
If non-null, sets the width of this widget to the child's width
multiplied by this factor.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this align widget to JSON.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited