# fluri 1.1.0

Fluri is a fluent URI library built to make URI mutation easy.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'fluri:1.1.0'
```
Published: 2015-12-09T21:01:39.553Z
Expected archive SHA-256: 617a5c6f1e7b01155a42fa35c42fe4bfc5d5a0ff8667bd34cefb1d585bcfa2f8

Available in cache; verification: upstream_checksum
## Direct dependencies

## Package README (untrusted upstream documentation)
# fluri 
[![Pub](https://img.shields.io/pub/v/fluri.svg)](https://pub.dartlang.org/packages/fluri) [![Build Status](https://travis-ci.org/Workiva/fluri.svg?branch=master)](https://travis-ci.org/Workiva/fluri) [![codecov.io](http://codecov.io/github/Workiva/fluri/coverage.svg?branch=master)](http://codecov.io/github/Workiva/fluri?branch=master)

> Fluri is a fluent URI library for Dart built to make URI mutation easy.

The `dart:core.Uri` class provides an immutable representation of URIs, which makes it difficult to incrementally build
them or update them at a later time. If you wanted to build a long URI from the individual pieces, you would do something like this:

```dart
Uri uri = new Uri(
  scheme: 'https',
  host: 'example.com',
  path: 'path/to/resource'
);
```

If you later wanted to update the path and add a query parameter, you'd have to do this:

```dart
uri = uri.replace(
  path: 'new/path',
  query: 'foo=true'
);
```

Now let's say you want update the query without losing what you already have:

```dart
Map query = new Map.from(uri.queryParameters);
query['bar'] = '10';
uri = uri.replace(queryParameters: query);
```

As you can see, incremental or fluent-style URI mutations become a hassle with the core `Uri` class.

With fluri, the above interactions are easy:

```dart
import 'package:fluri/fluri.dart';

Fluri fluri = new Fluri()
  ..scheme = 'https'
  ..host = 'example.com'
  ..path = 'path/to/resource';

fluri
  ..path = 'new/path'
  ..query = 'foo=true';

fluri.updateQuery({'bar': '10'});
```

Additional methods like `appendToPath` and `setQueryParam` make it easy to
build on top of a base URL:

```dart
import 'package:fluri/fluri.dart';

Fluri base = new Fluri('https://example.com/base/');

Fluri fluri = new Fluri.from(base)
  ..appendToPath('path/to/resource')
  ..setQueryParam('count', '10');
```

## Development

This project leverages [the dart_dev package](https://github.com/Workiva/dart_dev)
for most of its tooling needs, including static analysis, code formatting,
running tests, collecting coverage, and serving examples. Check out the dart_dev
readme for more information.
## Changelog
# Changelog

## 1.1.0

**New Features:**
- `appendToPath(path)` - append a path literal to the current path.
- `addPathSegment(segment)` - add a single path segment to the current path.
- `setQueryParam(param, value)` - set a single query parameter.
- `Fluri.from(other)` - construct a `Fluri` instance from another.
- `Fluri.fromUri(uri)` - construct a `Fluri` instance from a `Uri` instance.

## 1.0.1
_No source changes in this release._

- Add code coverage reporting.
- Minor fixes and improvements to the readme.
- Code formatting improvements thanks to `dartfmt`.


## 1.0.0
- Initial version of Fluri: a fluent URI library for Dart built to make URI mutation easy.







 
