dragBackSlide method

Widget dragBackSlide(
  1. BuildContext context,
  2. Animation<double> animation,
  3. Widget child
)

Follows the finger while a drag back is active and stays still otherwise. A route keeps it in its tree either way: wrapping the page only once the drag starts would move the page to a new parent, which rebuilds all of it.

Implementation

Widget dragBackSlide(
  BuildContext context,
  Animation<double> animation,
  Widget child,
) {
  return SlideTransition(
    position: _dragBackActive ? animation.drive(_slideTween) : _noSlide,
    textDirection: Directionality.of(context),
    child: child,
  );
}