Skip to content

Commit

Permalink
fix dart compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lvivski committed Jan 3, 2020
1 parent 466c9f5 commit 79c7969
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog

## 0.3.0

Fix support for dart@2

## 0.0.8

Breaking changes. Removed `hart` dependency, `start` now uses proper `Cookie` library,
Expand Down
6 changes: 3 additions & 3 deletions lib/src/request.dart
Expand Up @@ -55,7 +55,7 @@ class Request {
var completer = new Completer<Map>();

if (isMime('application/x-www-form-urlencoded')) {
_request.transform(const AsciiDecoder())
const AsciiDecoder().bind(_request)
.listen((content) {
final payload = new Map.fromIterable(
content.split('&').map((kvs) => kvs.split('=')),
Expand All @@ -67,7 +67,7 @@ class Request {
} else if (isMime('multipart/form-data', loose: true)) {
var boundary = _request.headers.contentType.parameters['boundary'];
final payload = new Map();
_request.transform(new MimeMultipartTransformer(boundary))
new MimeMultipartTransformer(boundary).bind(_request)
.map(HttpMultipartFormData.parse)
.listen((HttpMultipartFormData formData) {
var parameters = formData.contentDisposition.parameters;
Expand All @@ -85,7 +85,7 @@ class Request {
completer.complete(payload);
});
} else if (isMime('application/json')) {
_request.transform(const Utf8Decoder())
const Utf8Decoder().bind(_request)
.listen((content) {
final payload = jsonDecode(content);
completer.complete(payload);
Expand Down
12 changes: 6 additions & 6 deletions pubspec.yaml
Expand Up @@ -4,12 +4,12 @@ version: 0.3.0
homepage: http://github.com/lvivski/start
description: Sinatra inspired Web framework
environment:
sdk: '>=2.0.0'
sdk: '>=2.0.0 <3.0.0'
dependencies:
logging: any
http_server: any
mime: any
logging: '>=0.11.3 <0.12.0'
http_server: '>=0.9.8 <0.10.0'
mime: '>=0.9.6 <0.10.0'

dev_dependencies:
test: any
mockito: any
test: '>=1.9.4 <1.10.0'
mockito: '>=4.1.1 <4.2.0'

0 comments on commit 79c7969

Please sign in to comment.