pushNewScreen<T> function
Future<T?>
pushNewScreen<T>(
- BuildContext context, {
- required Widget screen,
- PageTransitionAnimation pageTransitionAnimation = PageTransitionAnimation.cupertino,
- 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));
}