StacSpacer class
A Stac model representing Flutter's Spacer
widget.
Inserts an adjustable, empty space in a Row
, Column
, or Flex
.
The amount of space taken is controlled by flex relative to
the other flexible children.
{@tool snippet} Dart Example:
StacRow(children: const [
StacText(data: 'Left'),
StacSpacer(),
StacText(data: 'Right'),
])
{@end-tool}
{@tool snippet} JSON Example:
{
"type": "row",
"children": [
{"type": "text", "data": "Left"},
{"type": "spacer"},
{"type": "text", "data": "Right"}
]
}
{@end-tool}
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacSpacer
- Annotations
-
- @JsonSerializable()
Constructors
- StacSpacer.new({int? flex})
-
Creates a StacSpacer that takes space according to
flex
.const -
StacSpacer.fromJson(Map<
String, dynamic> json) -
Creates a StacSpacer from a JSON map.
factory
Properties
- flex → int?
-
The flex factor to use for this spacer.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
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
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this StacSpacer instance to a JSON map.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited