FluriMixin class
A fluent URI mutation API built on top of Uri that can be easily extended or mixed in.
Useful for classes that deal with URI-based actions, like HTTP requests or WebSocket connections.
import 'package:fluri/fluri.dart';
// Option 1: Extending
class Request extends FluriMixin {}
// Option 2: Using as a Mixin
class Request extends Object with FluriMixin {}
void main() {
var req = Request()
..host = 'example.com'
..scheme = 'https'
..path = 'path/to/resource'
..queryParameters = {'limit': '10', 'format': 'json'};
print(req.uri.toString);
// https://example.com/path/to/resource?limit=10&format=json
}
- Implementers
Constructors
Properties
- fragment ↔ String
-
The URI fragment or hash.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- host ↔ String
-
The URI host, including sub-domains and the tld.
getter/setter pair
- path ↔ String
-
The URI path.
getter/setter pair
-
pathSegments
↔ Iterable<
String> -
The URI path segments.
getter/setter pair
- port ↔ int
-
The URI port number.
getter/setter pair
- query ↔ String
-
The URI query string.
getter/setter pair
-
queryParameters
↔ Map<
String, String> -
The URI query parameters.
getter/setter pair
-
queryParametersAll
↔ Map<
String, List< String> > -
The URI query parameters with support for multi-value params.
getter/setter pair
- 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 pair - uri ↔ Uri
-
The full URI.
getter/setter pair
Methods
-
addPathSegment(
String pathSegment) → void - Add a single path segment to the end of the current path.
-
appendToPath(
String pathToAppend) → void - Append to the current path.
-
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. -
setQueryParam(
String param, dynamic value) → void - Set a single query parameter.
-
toString(
) → String -
A string representation of this object.
inherited
-
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.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited