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