normalizeQueryParams method

String normalizeQueryParams (String params)

Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as is.

Implementation

static String normalizeQueryParams(String params) {
  return params.isEmpty || params.startsWith('?') ? params : '?$params';
}