toNamed static method

Future toNamed(
  1. String name
)

Pushes a named route onto the navigation stack

name - The route name to navigate to

Returns a Future that completes when the navigation is finished

Implementation

static Future toNamed(String name) async {
  return await Navigator.of(libNavigatorKey.currentContext!).pushNamed(
    name,
  );
}