fade method
Wraps the widget with a controllable fade animation.
Example:
Text('Hello').fade(opacity: 0.5);
Implementation
Widget fade({
double opacity = 1.0,
Duration duration = const Duration(milliseconds: 300),
Curve curve = Curves.easeInOut,
}) {
return AnimatedOpacity(
opacity: opacity,
duration: duration,
curve: curve,
child: this,
);
}