navigate method

dynamic navigate({
  1. required String path,
  2. bool replace = false,
  3. Object? extra,
})

Implementation

navigate({required String path, bool replace = false, Object? extra}) {
  if (navigatorKey.currentContext != null) {
    if (replace) {
      navigatorKey.currentContext!.replace(
        path,
        extra: extra,
      );
    } else {
      (navigatorKey.currentContext!).go(
        path,
        extra: extra,
      );
    }
  }
}