push<T> method

Future<T?> push<T>(
  1. Route<T> route
)

Equals to Navigator.of(context).push() Give it the Route you want to push

Example

context.push(MaterialPageRoute(builder: (context) => CounterPage()));

Implementation

Future<T?> push<T>(Route<T> route) async => Navigator.of(this).push<T>(route);