push<T extends Object?> method
Future<T?>
push<T extends Object?>(
- Widget screen, {
- RouteSettings? settings,
- bool maintainState = true,
- bool fullscreenDialog = false,
Pushes a new screen onto the navigator.
Allows customization of the route via settings, maintainState, and
fullscreenDialog. rootNavigator determines whether to push the route
onto the root navigator or the nearest Navigator ancestor.
Returns a Future that completes with the result of the pushed route when it is popped.
Implementation
Future<T?> push<T extends Object?>(
Widget screen, {
RouteSettings? settings,
bool maintainState = true,
bool fullscreenDialog = false,
bool rootNavigator = false,
}) async =>
await Navigator.of(
this,
rootNavigator: rootNavigator,
).push(MaterialPageRoute(
builder: (_) => screen,
settings: settings,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
));