StacPadding class

A Stac widget that adds padding around its child.

This widget corresponds to Flutter's Padding widget and provides space around its child widget using edge insets.

{@tool snippet} Dart Example:

const StacPadding(
  padding: StacEdgeInsets.all(16.0),
  child: StacText(data: 'Padded content'),
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "padding",
  "padding": 16.0,
  "child": {
    "type": "text",
    "data": "Padded content"
  }
}

{@end-tool}

Inheritance
Annotations
  • @JsonSerializable()

Constructors

StacPadding.new({StacEdgeInsets? padding, StacWidget? child})
Creates a padding widget with optional padding and child.
const
StacPadding.fromJson(Map<String, dynamic> json)
Creates a StacPadding from a JSON map.
factory

Properties

child StacWidget?
The widget to apply padding to.
final
hashCode int
The hash code for this object.
no setterinherited
jsonData Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
padding StacEdgeInsets?
The amount of space to pad the child.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The type of the widget
no setteroverride

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