Skip to main content
The Stac SliverPadding allows you to inset a sliver widget by a given padding using JSON. It is typically used inside a CustomScrollView. To know more about the sliver padding widget in Flutter, refer to the official documentation.

Properties

PropertyTypeDescription
paddingMap<String, dynamic>The amount of space by which to inset the child.
sliverMap<String, dynamic>The sliver widget inside the padding.

Example

StacSliverPadding(
  padding: StacEdgeInsets.all(16.0),
  sliver: StacSliverToBoxAdapter(
    child: StacContainer(
      height: 150,
      color: StacColors.green,
      child: StacCenter(
        child: StacText(
          data: 'I am a Box inside a SliverPadding!',
          style: StacTextStyle(color: StacColors.white, fontWeight: StacFontWeight.bold),
        ),
      ),
    ),
  ),
)