push<T extends Object> method

  1. @optionalTypeArgs
Future<T> push <T extends Object>(BuildContext context, Route<T> route)

Push the given route onto the navigator that most tightly encloses the given context.

Sample code

Typical usage is as follows:

void _openMyPage() {
  Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context) => new MyPage()));
}

Implementation

@optionalTypeArgs
static Future<T> push<T extends Object>(BuildContext context, Route<T> route) {
  return Navigator.of(context).push(route);
}