withBottomFade method

Widget withBottomFade({
  1. required BuildContext context,
  2. Color? fadeColor,
  3. double startFade = 0.97,
  4. AlignmentGeometry? begin,
  5. AlignmentGeometry? end,
  6. List<double>? stops,
  7. Rect shaderRect(
    1. Rect
    )?,
  8. BlendMode? blendMode,
})

Implementation

Widget withBottomFade({
  required BuildContext context,
  Color? fadeColor,
  double startFade = 0.97,
  AlignmentGeometry? begin,
  AlignmentGeometry? end,
  List<double>? stops,
  Rect Function(Rect)? shaderRect,
  BlendMode? blendMode,
}) {
  Color overlayColor = fadeColor ?? Theme.of(context).colorScheme.surface;
  return FadeContainer(
    child: this,
    fadeColors: [context.transparent, overlayColor],
    begin: begin ?? Alignment.topCenter,
    end: end ?? Alignment.bottomCenter,
    stops: stops ?? [startFade, 1.0],
    shaderRect: shaderRect ?? (rect) => rect,
    blendMode: blendMode ?? BlendMode.srcATop,
  );
}