push<T> static method

Future push<T>(
  1. BuildContext context,
  2. Widget page, {
  3. bool fullscreenDialog = false,
  4. RouteSettings? settings,
  5. String? name,
})

short handed push navigator name parameter can be use instead of settings if you only need to provider name

Implementation

static Future push<T>(
  BuildContext context,
  Widget page, {
  bool fullscreenDialog = false,
  RouteSettings? settings,
  String? name,
}) async {
  return await Navigator.of(context).push<T>(
    MaterialPageRoute(
      builder: (context) => page,
      fullscreenDialog: fullscreenDialog,
      settings: name != null ? RouteSettings(name: name) : settings,
    ),
  );
}