top static method

FadeContainer top({
  1. required BuildContext context,
  2. required Widget child,
  3. Color? fadeColor,
  4. double stopFade = 0.03,
})

Implementation

static FadeContainer top({
  required BuildContext context,
  required Widget child,
  Color? fadeColor,
  double stopFade = 0.03,
}) {
  Color overlayColor = fadeColor ?? context.colorScheme.surface;
  return FadeContainer(
    child: child,
    begin: Alignment.topCenter,
    end: Alignment.bottomCenter,
    fadeColors: [
      overlayColor,
      Colors.transparent,
    ],
    stops: [0, stopFade],
    shaderRect: (rect) => rect,
  );
}