withFade method
Wrap with fade animation on appear.
Implementation
Widget withFade({
Duration duration = const Duration(milliseconds: 300),
Curve curve = Curves.easeInOut,
}) {
return TweenAnimationBuilder<double>(
tween: Tween(begin: 0.0, end: 1.0),
duration: duration,
curve: curve,
builder: (context, opacity, child) => Opacity(
opacity: opacity,
child: child,
),
child: this,
);
}