navigateToReturn function

Future navigateToReturn(
  1. BuildContext context,
  2. Widget widget
)

Implementation

Future navigateToReturn(BuildContext context, Widget widget) async {
    final leData = await Navigator.of(context).push(
        PageRouteBuilder(
            pageBuilder: (context, animation, secondaryAnimation) => widget,
            transitionDuration: Duration.zero,
            reverseTransitionDuration: Duration.zero,
        ),
    );

    return leData;
}