fade static method

VillainAnimation fade({
  1. double fadeFrom = 0.0,
  2. double fadeTo = 1.0,
  3. Duration from = Duration.zero,
  4. Duration to = _kMaterialRouteTransitionLength,
  5. Curve curve = Curves.linear,
})

Implementation

static VillainAnimation fade({
  double fadeFrom = 0.0,
  double fadeTo = 1.0,
  Duration from = Duration.zero,
  Duration to: _kMaterialRouteTransitionLength,
  Curve curve: Curves.linear,
}) =>
    VillainAnimation(
        from: from,
        curve: curve,
        to: to,
        animatable: Tween<double>(begin: fadeFrom, end: fadeTo),
        animatedWidgetBuilder: (animation, child) {
          return FadeTransition(
            opacity: animation as Animation<double>,
            child: child,
          );
        });