Skip to content

Commit ad0044b

Browse files
committed
Updated dev channel
1 parent d250991 commit ad0044b

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ install:
1919
deploy:
2020
provider: script
2121
skip_cleanup: true
22-
script: pub publish -f
22+
script: dart format ./lib/ && pub publish -f
2323
on:
2424
tags: true

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file:
2020

2121
```yml
2222
dependencies:
23-
appwrite: ^0.4.0-dev.2
23+
appwrite: ^0.4.0-dev.3
2424
```
2525
2626
You can install packages from the command line:
@@ -29,6 +29,7 @@ You can install packages from the command line:
2929
pub get appwrite
3030
```
3131

32+
3233
## Contribution
3334

3435
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.

lib/appwrite.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
library appwrite;
22

33
import 'dart:io';
4+
import 'dart:convert';
45
import 'package:universal_html/html.dart' as html;
56
import 'package:dio/dio.dart';
67
import 'package:meta/meta.dart';

lib/client.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Client {
2525

2626
this.headers = {
2727
'content-type': 'application/json',
28-
'x-sdk-version': 'appwrite:flutter:0.4.0-dev.2',
28+
'x-sdk-version': 'appwrite:flutter:0.4.0-dev.3',
2929
};
3030

3131
this.config = {};
@@ -126,6 +126,14 @@ class Client {
126126
if(e.response == null) {
127127
throw AppwriteException(e.message);
128128
}
129+
if(responseType == ResponseType.bytes) {
130+
if(e.response.headers['content-type'].contains('application/json')) {
131+
final res = json.decode(utf8.decode(e.response.data));
132+
throw AppwriteException(res['message'],res['code'], e.response);
133+
} else {
134+
throw AppwriteException(e.message);
135+
}
136+
}
129137
throw AppwriteException(e.response.data['message'],e.response.data['code'], e.response.data);
130138
} catch(e) {
131139
throw AppwriteException(e.message);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: appwrite
2-
version: 0.4.0-dev.2
2+
version: 0.4.0-dev.3
33
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
44
homepage: https://appwrite.io
55
repository: https://github.com/appwrite/sdk-for-flutter

0 commit comments

Comments
 (0)