push<T> method
Push to a route with the given Widget and return generic Type T
Implementation
Future<T?> push<T>(Widget widget) {
return Navigator.of(
this,
).push<T>(MaterialPageRoute<T>(builder: (BuildContext context) => widget));
}