slideIn function
This slides in the content of the transition, from the specified initial offset (i.e. initialOffset) to Offset.zero. The offset is defined in terms of fractions of the transition's size.
By default, the content will slide in from the bottom right corner of the transition, and Curves.linear is used by default.
The direction of the slide can be controlled by configuring the initialOffset. A positive x value means sliding from right to left, whereas a negative x value will slide the content to the right. Similarly positive and negative y values correspond to sliding up and down, respectively. If the sliding is only desired horizontally or vertically, instead of along both axis, consider using slideInHorizontally or slideInVertically. Params:
curve
- the easing curve for this animation, Curves.linear by defaultinitialOffset
- the starting offset of the enter transition, Offset(1.0, 1.0) by default
Implementation
EnterTransition slideIn({
Offset initialOffset = const Offset(1.0, 1.0),
Curve curve = Curves.linear,
}) {
final slideTransition =
Tween(begin: initialOffset, end: const Offset(0.0, 0.0))
.chain(CurveTween(curve: curve));
return EnterTransitionImpl(
TransitionData(slide: Slide(initialOffset, slideTransition)),
);
}