uri property Null safety

Uri uri

generate uri

Implementation

Uri get uri {
  var _url = path;
  if (!_url.startsWith(RegExp(r'https?:'))) {
    _url = baseUrl + _url;
    var s = _url.split(':/');
    _url = s[0] + ':/' + s[1].replaceAll('//', '/');
  }
  var query = Transformer.urlEncodeMap(queryParameters, listFormat);
  if (query.isNotEmpty) {
    _url += (_url.contains('?') ? '&' : '?') + query;
  }
  // Normalize the url.
  return Uri.parse(_url).normalizePath();
}