$location method Null safety

String $location(
  1. String path,
  2. {Map<String, String>? queryParams}
)

A helper function used by generated code.

Should not be used directly.

Implementation

static String $location(String path, {Map<String, String>? queryParams}) =>
    Uri.parse(path)
        .replace(
          queryParameters:
              // Avoid `?` in generated location if `queryParams` is empty
              queryParams?.isNotEmpty ?? false ? queryParams : null,
        )
        .toString();