Understanding the Uri class in Dart (from examples)

How do I parse out the individual pieces of a URL?

The Uri class in Dart has good documentation, but sometimes seeing examples makes it a lot easier to understand. This article will show examples for all of the main parameters to make them more clear.

Creating a Uri

You can create a Uri by parsing string like this:

Uri uri = Uri.parse('http://www.example.com');

--

--

--

Flutter and Dart developer. Twitter: @suragch1

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why I’m joining Timescale to help build the next foundational database company

Query Logs the AWS WAF using Amazon Athena.

Contributing to team workflow in software development

CLI Project “Week”

Let’s install qBittorrent on Docker

What Do You Pay for in AR/VR Development?

What Do You Pay for in AR/VR Development?

How to check the efficiency of Code Review

Ensure Uniqueness of Nullable Columns

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Suragch

Suragch

Flutter and Dart developer. Twitter: @suragch1

More from Medium

Flutter | The Comming future

A Tale of Three (Flutter) Trees

A minimalist guide to Dependency Injection in Flutter

What is Google Flutter? | Everything You Need To Know About Flutter