animatedOpacity method
Animated version of Opacity which automatically transitions the child's opacity over a given duration whenever the given opacity changes.
Implementation
Widget animatedOpacity({
required double opacity,
required Duration duration,
Key? key,
Curve curve = Curves.linear,
VoidCallback? onEnd,
bool alwaysIncludeSemantics = false,
}) {
return AnimatedOpacity(
key: key,
opacity: opacity,
curve: curve,
duration: duration,
onEnd: onEnd,
alwaysIncludeSemantics: alwaysIncludeSemantics,
child: this,
);
}