animateFade method

Widget animateFade({
  1. Key? key,
  2. double opacity = 1.0,
  3. Duration duration = const Duration(milliseconds: 300),
  4. Curve curve = Curves.easeOut,
})

Wraps a widget in an easy implicit animated opacity/fade effect

Implementation

Widget animateFade({
  Key? key,
  double opacity = 1.0,
  Duration duration = const Duration(milliseconds: 300),
  Curve curve = Curves.easeOut,
}) {
  return AnimatedOpacity(
    key: key,
    opacity: opacity,
    duration: duration,
    curve: curve,
    child: this,
  );
}