topAndBottom static method

FadeContainer topAndBottom({
  1. required BuildContext context,
  2. required Widget child,
  3. Color? fadeColor,
  4. double startFade = 0.97,
})

Implementation

static FadeContainer topAndBottom({
  required BuildContext context,
  required Widget child,
  Color? fadeColor,
  double startFade = 0.97,
}) {
  var overlayColor = fadeColor ?? context.colorScheme.surface;
  return FadeContainer(
    child: child,
    fadeColors: [
      overlayColor,
      Colors.transparent,
      Colors.transparent,
      overlayColor
    ],
    stops: [
      0,
      (1 - startFade),
      startFade,
      1.0,
    ],
    shaderRect: (rect) => rect,
  );
}