Ephenodrom / Dart-Basic-Utils

A dart package for many helper methods fitting common situations
MIT License
364 stars 77 forks source link

Fixing error Error: The argument type 'String' can't be assigned to t… #38

Closed MedwinCorreo closed 3 years ago

MedwinCorreo commented 3 years ago

…he parameter type 'Uri'.

Error: The argument type 'String' can't be assigned to the parameter type 'Uri'.

image

Ephenodrom commented 3 years ago

This should not be necessary, since everytime before for example

await client.get(finalUrl, headers: headers);

is called, the code runs through this method:

static Uri _getUriUrl(
      String url, Map<String, dynamic>? queryParameters) {
    if (queryParameters == null || queryParameters.isEmpty) return Uri.parse(url);
    return Uri.parse(url).replace(queryParameters: queryParameters);
  }

Therefore the string is in everycase parsed as an URI object. Is your code up to date and do you use the latest version of the package ?

@MedwinCorreo / @rwrz

rwrz commented 3 years ago

Yeah. I just realize that... sorry about reviewing it wrongly. This PR is not necessary anymore, the _getUriUrl does the job.

Ephenodrom commented 3 years ago

The PR will be closed. Alread fixed in the latest Version.