transformTranslate static method

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

Implementation

static VillainAnimation transformTranslate({
  Offset toOffset = Offset.zero,
  required Offset fromOffset,
  Duration from = Duration.zero,
  required Duration to,
  Curve curve = Curves.linear,
}) =>
    VillainAnimation(
        curve: curve,
        from: from,
        to: to,
        animatable: Tween<Offset>(begin: fromOffset, end: toOffset),
        animatedWidgetBuilder: (animation, child) {
          return AnimatedBuilder(
            animation: animation,
            builder: (BuildContext a, Widget? b) {
              return Transform.translate(
                offset: animation.value,
                child: child,
              );
            },
          );
        });