translate static method

VillainAnimation translate({
  1. Offset? fromOffset,
  2. Offset? toOffset,
  3. Duration from = Duration.zero,
  4. Duration to = _kMaterialRouteTransitionLength,
  5. Curve curve = Curves.linear,
})

Implementation

static VillainAnimation translate({
  Offset? fromOffset,
  Offset? toOffset,
  Duration from = Duration.zero,
  Duration to = _kMaterialRouteTransitionLength,
  Curve curve = Curves.linear,
}) =>
    VillainAnimation(
        from: from,
        to: to,
        curve: curve,
        animatable: Tween<Offset>(begin: fromOffset, end: toOffset),
        animatedWidgetBuilder: (animation, child) {
          return SlideTransition(
            position: animation as Animation<Offset>,
            child: child,
          );
        });