fadeIn method

Widget fadeIn({
  1. Duration duration = const Duration(milliseconds: 300),
  2. Curve curve = Curves.easeIn,
})

Animate with fade in

Implementation

Widget fadeIn({
  Duration duration = const Duration(milliseconds: 300),
  Curve curve = Curves.easeIn,
}) {
  return TweenAnimationBuilder<double>(
    duration: duration,
    curve: curve,
    tween: Tween<double>(begin: 0.0, end: 1.0),
    builder: (context, value, child) {
      return Opacity(
        opacity: value,
        child: child,
      );
    },
    child: this,
  );
}