base_uri 1.0.0
base_uri: ^1.0.0 copied to clipboard

A tiny wrapper around Uri to easily define a base uri that is reusable for all your endpoints. It also adds a version parameter.

base_uri #

A tiny wrapper around Uri to easily define a base uri. Supports api versions.

Getting Started #

Create a base Uri

final BASE_URI = BaseUri(
  scheme: 'https',
  host: 'example.com',
  version: 'v1',
);

then use it accross your app

BASE_URI.useWith('/path'); // https://example.com/v1/path
BASE_URI.useWith('/path', queryParameters: {'test': 'yes'}); // https://example.com/v1/path?test=yes
0
likes
120
pub points
35%
popularity

A tiny wrapper around Uri to easily define a base uri that is reusable for all your endpoints. It also adds a version parameter.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

thiebaud.tom@gmail.com

License

BSD (LICENSE)

More

Packages that depend on base_uri