animatedPositioned method

Widget animatedPositioned({
  1. required Duration duration,
  2. Key? key,
  3. double? left,
  4. double? top,
  5. double? right,
  6. double? bottom,
  7. double? width,
  8. double? height,
  9. Curve curve = Curves.linear,
  10. VoidCallback? onEnd,
})

Animated version of Positioned which automatically transitions the child's position over a given duration whenever the given position changes.

Only works if it's the child of a Stack.

Implementation

Widget animatedPositioned({
  required Duration duration,
  Key? key,
  double? left,
  double? top,
  double? right,
  double? bottom,
  double? width,
  double? height,
  Curve curve = Curves.linear,
  VoidCallback? onEnd,
}) {
  return AnimatedPositioned(
    key: key,
    left: left,
    top: top,
    right: right,
    bottom: bottom,
    width: width,
    height: height,
    curve: curve,
    duration: duration,
    onEnd: onEnd,
    child: this,
  );
}