push<T> method

Future<T?> push<T>(
  1. Widget widget
)

Pushes a new route onto the navigator.

Implementation

Future<T?> push<T>(Widget widget) async {
  final result = await _key.currentState?.push<T>(
    MaterialPageRoute(
      builder: (_) => widget,
      settings: RouteSettings(name: widget.runtimeType.toString()),
    ),
  );

  return result;
}