StacSliverPadding class

A Stac model representing Flutter's SliverPadding widget.

Insets its sliver child by the given padding.

{@tool snippet} Dart Example:

const StacSliverPadding(
  padding: StacEdgeInsets.all(16),
  sliver: StacSliverToBoxAdapter(...),
)

{@end-tool}

{@tool snippet} JSON Example:

{
    "type": "sliverPadding",
    "padding": 16.0,
    "sliver": {
        "type": "sliverToBoxAdapter",
        "child": {
            "type": "container",
            "height": 150,
            "color": "#4CAF50",
            "child": {
                "type": "center",
                "child": {
                    "type": "text",
                    "data": "I am a Box inside a SliverPadding!",
                    "style": {
                        "color": "#FFFFFF",
                        "fontWeight": "bold"
                    }
                }
            }
        }
    }
}

{@end-tool}

See also:

Inheritance
Annotations
  • @JsonSerializable.new()

Constructors

StacSliverPadding({required StacWidget sliver, required StacEdgeInsets padding})
Creates a StacSliverPadding.
const
StacSliverPadding.fromJson(Map<String, dynamic> json)
Creates a StacSliverPadding from a JSON map.
factory

Properties

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 by which to inset the child sliver.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sliver StacWidget
The sliver to apply padding to.
final
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 StacSliverPadding instance to JSON.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited