SliverGutter constructor
Creates a SliverGutter widget.
Initializes the wrapper for sliver padding, requiring the sliver child to pad.
The enabled parameter determines if GutterTheme.gutterCalc is invoked with current screen width from MediaQuery, defaulting to true for standard responsive behavior.
Initialization logic: Defers padding computation to build time, ensuring context-aware theme access without early evaluation.
Example in a scrollable layout:
CustomScrollView(
slivers: [
SliverGutter(
sliver: SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) => ListTile(
title: Text("Item $index"),
),
childCount: 20,
),
),
),
],
)
This applies symmetric horizontal padding, scaling with device width for optimal content framing.
Implementation
const SliverGutter({super.key, required this.sliver, this.enabled = true});