navigateTo static method

Future navigateTo({
  1. Widget? page,
  2. GlobalKey<NavigatorState>? navigationKey,
})

Implementation

static Future<dynamic> navigateTo(
    {Widget? page, GlobalKey<NavigatorState>? navigationKey}) {
  if (navigationKey == null) {
    return _navigationKey.currentState!.push(MaterialPageRoute(
        builder: (context) => page ?? ConnectivityScreen()));
  } else
    return navigationKey.currentState!.push(MaterialPageRoute(
        builder: (context) => page ?? ConnectivityScreen()));
}