navigateToNamed method
dynamic
navigateToNamed(
Implementation
navigateToNamed(
String routeName, {
bool replace = false,
Map<String, String>? params,
Map<String, dynamic>? queryParams,
}) {
if (navigatorKey.currentContext != null) {
if (replace) {
if (params != null && queryParams != null) {
navigatorKey.currentContext!.goNamed(
routeName,
params: params,
queryParams: queryParams,
);
} else {
if (params != null) {
(navigatorKey.currentContext!).goNamed(
routeName,
params: params,
);
} else if (queryParams != null) {
(navigatorKey.currentContext!).goNamed(
routeName,
queryParams: queryParams,
);
} else {
navigatorKey.currentContext!.goNamed(
routeName,
);
}
}
} else {
if (params != null && queryParams != null) {
(navigatorKey.currentContext!).goNamed(
routeName,
params: params,
queryParams: queryParams,
);
} else {
if (params != null) {
(navigatorKey.currentContext!).goNamed(
routeName,
params: params,
);
} else if (queryParams != null) {
(navigatorKey.currentContext!).goNamed(
routeName,
queryParams: queryParams,
);
} else {
(navigatorKey.currentContext!).goNamed(
routeName,
);
}
}
}
}
}