push<T> static method

Future<T?> push<T>(
  1. Widget page, {
  2. String? routeName,
})

Implementation

static Future<T?> push<T>(Widget page, {String? routeName}) {
  return Navigator.of(currentContext!).push<T>(
    MaterialPageRoute(
      builder: (context) => page,
      settings: routeName != null ? RouteSettings(name: routeName) : null,
    ),
  );
}