transformTranslate static method
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,
);
},
);
});