slideTransition method

Widget slideTransition({
  1. required Animation<Offset> position,
  2. Key? key,
  3. bool transformHitTests = true,
  4. TextDirection? textDirection,
})

Animates the position of a widget relative to its normal position.

The translation is expressed as an Offset scaled to the child's size. For example, an Offset with a dx of 0.25 will result in a horizontal translation of one quarter the width of the child.

By default, the offsets are applied in the coordinate system of the canvas (so positive x offsets move the child towards the right). If a textDirection is provided, then the offsets are applied in the reading direction, so in right-to-left text, positive x offsets move towards the left, and in left-to-right text, positive x offsets move towards the right

Implementation

Widget slideTransition({
  required Animation<Offset> position,
  Key? key,
  bool transformHitTests = true,
  TextDirection? textDirection,
}) {
  return SlideTransition(
    key: key,
    position: position,
    transformHitTests: transformHitTests,
    textDirection: textDirection,
    child: this,
  );
}