toScreen static method

Future toScreen(
  1. Widget screen,
  2. String name
)

Pushes a screen onto the navigation stack

screen - The widget to display as the screen name - The route name for the screen

Returns a Future that completes when the navigation is finished

Implementation

static Future toScreen(Widget screen, String name) async {
  return await Navigator.of(
          DevLoggerUI.instance.navigatorKey!.currentContext!)
      .push(
    MaterialPageRoute(
        builder: (context) => screen, settings: RouteSettings(name: name)),
  );
}