buildTransitions method

  1. @override
Widget buildTransitions(
  1. BuildContext context,
  2. Animation<double> animation,
  3. Animation<double> secondaryAnimation,
  4. Widget child,
)
override

Creates transition which going forwards from tapped coordinates. A similar situation is with transition in reverse.

Implementation

@override
Widget buildTransitions(
  BuildContext context,
  Animation<double> animation,
  Animation<double> secondaryAnimation,
  Widget child,
) {
  var _alignment = Alignment(0, 0);
  if (tapDetails != null) {
    final _converter = CoordinatesToAlignment(
      point: tapDetails!.globalPosition,
      screenSize: MediaQuery.of(context).size,
    );
    _alignment = _converter.convert();
  }
  return FadeTransition(
    opacity: animation,
    child: ScaleTransition(
      scale: animation,
      child: child,
      alignment: _alignment,
    ),
  );
}