pushNewScreen<T> function

Future<T?> pushNewScreen<T>(
  1. BuildContext context, {
  2. required Widget screen,
  3. bool? withNavBar,
  4. PageTransitionAnimation pageTransitionAnimation = PageTransitionAnimation.cupertino,
  5. PageRoute? customPageRoute,
})

Implementation

Future<T?> pushNewScreen<T>(
  BuildContext context, {
  required Widget screen,
  bool? withNavBar,
  PageTransitionAnimation pageTransitionAnimation = PageTransitionAnimation.cupertino,
  PageRoute? customPageRoute,
}) {
  if (withNavBar == null) {
    withNavBar = true;
  }
  return Navigator.of(context, rootNavigator: !withNavBar)
      .push<T>(customPageRoute as Route<T>? ?? getPageRoute(pageTransitionAnimation, enterPage: screen));
}