StacSizedBox class
A Stac model representing Flutter's SizedBox widget.
A box with a specified size.
If given a child, this widget forces its child to have a specific width and/or height. If not given a child, SizedBox will try to size itself to the specified width and height, and then shrinkwrap if the dimensions are not specified.
StacSizedBox(
width: 100.0,
height: 50.0,
child: StacText(data: 'Content'),
)
{
"type": "sizedBox",
"width": 100.0,
"height": 50.0,
"child": {"type": "text", "data": "Content"}
}
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacSizedBox
- Available extensions
- Annotations
-
- @JsonSerializable.new()
Constructors
- StacSizedBox({double? width, double? height, StacWidget? child})
-
Creates a StacSizedBox with the given properties.
const
-
StacSizedBox.fromJson(Map<
String, dynamic> json) -
Creates a StacSizedBox from JSON.
factory
Properties
- child → StacWidget?
-
The widget below this widget in the tree.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
The height of the box.
If null, the box will try to be as high as its parent allows.
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
- width → double?
-
The width of the box.
If null, the box will try to be as wide as its parent allows.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
BuildContext context) → Widget? -
Available on StacWidget?, provided by the StacWidgetParser extension
-
parsePreferredSizeWidget(
BuildContext context) → PreferredSizeWidget? -
Available on StacWidget?, provided by the StacWidgetParser extension
-
toJson(
) → Map< String, dynamic> -
Converts this StacSizedBox to JSON.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited