slide method

Widget slide({
  1. Offset offset = Offset.zero,
  2. Duration duration = const Duration(milliseconds: 300),
  3. Curve curve = Curves.easeInOut,
})

Wraps the widget with a slide animation.

Example:

Text('Hello').slide(offset: Offset(0.5, 0));

Implementation

Widget slide({
  Offset offset = Offset.zero,
  Duration duration = const Duration(milliseconds: 300),
  Curve curve = Curves.easeInOut,
}) {
  return AnimatedSlide(
    offset: offset,
    duration: duration,
    curve: curve,
    child: this,
  );
}