push<T extends Object?> method
Pushes a new page onto the navigator stack and returns a Future that completes when the new page is popped.
This is the preferred method for standard navigation and waiting for a result.
Implementation
Future<T?> push<T extends Object?>(Widget page) {
return Navigator.push<T>(
this, MaterialPageRoute(builder: (context) => page));
}