CustomGradientContainer constructor
CustomGradientContainer({
- Key? key,
- dynamic gradient = const LinearGradient(begin: Alignment.centerLeft, end: Alignment.centerRight, stops: [0, 1], colors: [Color.fromRGBO(0, 0, 0, 0.2), Color.fromRGBO(0, 0, 0, 0)]),
- required Widget child,
- double strokeWidth = 5,
- VoidCallback? onPressed,
Implementation
CustomGradientContainer({
super.key,
gradient = const LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
stops: [0, 1],
colors: [
Color.fromRGBO(0, 0, 0, 0.2),
Color.fromRGBO(0, 0, 0, 0),
],
),
required this.child,
this.strokeWidth = 5,
this.onPressed,
}) : painter = CustomGradient(gradient: gradient, strokeWidth: strokeWidth);