silverInsetsOnly method

Widget silverInsetsOnly({
  1. double top = 0.0,
  2. double left = 0.0,
  3. double right = 0.0,
  4. double bottom = 0.0,
})

Add a margin to a side of a Sliver widget.

Implementation

Widget silverInsetsOnly({
  double top = 0.0,
  double left = 0.0,
  double right = 0.0,
  double bottom = 0.0,
}) {
  final String className = toStringShort();
  final isSliverWidget = className.startsWith('Sliver');
  assert(isSliverWidget, 'Please use widgets of type Sliver...');
  return SliverPadding(
    padding: EdgeInsets.only(
      top: top,
      left: left,
      right: right,
      bottom: bottom,
    ),
    sliver: this,
  );
}