navigateTo method

dynamic navigateTo({
  1. required String path,
  2. bool replace = false,
})

Implementation

navigateTo({
  required String path,
  bool replace = false,
}) {
  if (navigatorKey.currentContext != null) {
    if (replace) {
      navigatorKey.currentContext!.replace(
        path,
      );
    } else {
      (navigatorKey.currentContext!).go(
        path,
      );
    }
  }
}