pushNewScreen<T> static method

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

Once you push a screen with withNavBar set to false, Navigation bar cannot appear in screens pushed from here forward unless you define a new PersistentTabView on those screens.

Implementation

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