VOOZH about

URL: https://www.geeksforgeeks.org/dart/dart-uris/

⇱ Dart - URIs - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Dart - URIs

Last Updated : 11 Apr, 2025

The Uri class supports functions to encode and decode strings for use in URIs (which you might know as URLs). These functions control characters that are unique for URIs, such as & and =. This class also parses and exposes the components of a URI—host, port, scheme, and so on.

Encoding and decoding fully qualified URIs

The encodeFull() and decodeFull() methods are used to encode and decode characters except those with special meaning in a URI (such as /, use:, &, #).

Example: 

Output:

true


Encoding and decoding URI components

To encode and decode all of a string’s characters that have special meaning in a URI, including (but not limited to) /, &, and :, use the encodeComponent() and decodeComponent() methods.

Example:

Output:

true


Parsing URIs

If you have a URI object or a URI string, you can get its parts using URI fields such as path. To create a URI from a string, use the parse() static method.

Example:

Output:

true


Building URIs

You can use the Uri() constructor is used to build up a URI from individual parts.

Example:

Output:

true


Comment
Article Tags:
Article Tags:

Explore