decodeComponent static method

String decodeComponent(
  1. String encodedComponent
)

Decodes the percent-encoding in encodedComponent.

Note that decoding a URI component might change its meaning as some of the decoded characters could be characters which are delimiters for a given URI component type. Always split a URI component using the delimiters for the component before decoding the individual parts.

For handling the path and query components, consider using pathSegments and queryParameters to get the separated and decoded component.

Example:

final decoded =
    Uri.decodeComponent('http%3A%2F%2Fexample.com%2Fsearch%3DDart');
print(decoded); // http://example.com/search=Dart

Implementation

static String decodeComponent(String encodedComponent) {
  return _Uri._uriDecode(
      encodedComponent, 0, encodedComponent.length, utf8, false);
}