Fluri class
A fluent URI mutation API built on top of Uri.
Fluri can be used as a replacement for Uri and gives you the benefit of easily and incrementally mutating a URI.
import 'package:fluri/fluri.dart';
void main() {
var fluri = Fluri()
..host = 'example.com'
..scheme = 'https'
..path = 'path/to/resource'
..queryParameters = {'limit': '10', 'format': 'json'};
print(fluri.toString());
// https://example.com/path/to/resource?limit=10&format=json
}
If you need access to the underlying Uri
instance, you
can access it via the uri
property:
import 'package:fluri/fluri.dart';
void main() {
Fluri fluri = new Fluri();
Uri uri = fluri.uri;
}
- Inheritance
-
- Object
- FluriMixin
- Fluri
Constructors
Properties
- fragment ↔ String
-
The URI fragment or hash.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- host ↔ String
-
The URI host, including sub-domains and the tld.
getter/setter pairinherited
- path ↔ String
-
The URI path.
getter/setter pairinherited
-
pathSegments
↔ Iterable<
String> -
The URI path segments.
getter/setter pairinherited
- port ↔ int
-
The URI port number.
getter/setter pairinherited
- query ↔ String
-
The URI query string.
getter/setter pairinherited
-
queryParameters
↔ Map<
String, String> -
The URI query parameters.
getter/setter pairinherited
-
queryParametersAll
↔ Map<
String, List< String> > -
The URI query parameters with support for multi-value params.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scheme ↔ String
-
The URI scheme or protocol. Examples:
http
,https
,ws
.getter/setter pairinherited - uri ↔ Uri
-
The full URI.
getter/setter pairinherited
Methods
-
addPathSegment(
String pathSegment) → void -
Add a single path segment to the end of the current path.
inherited
-
appendToPath(
String pathToAppend) → void -
Append to the current path.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeQueryParam(
String param) → void -
Remove
param
from the URI query parameters.inherited -
setQueryParam(
String param, dynamic value) → void -
Set a single query parameter.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
updateQuery(
Map< String, dynamic> queryParametersToUpdate, {bool mergeValues = false}) → void -
Update the URI query parameters, merging the given map with the
current query parameters map instead of overwriting it.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited