Skip to content

Commit e714f9a

Browse files
committed
Updated for beta release
1 parent 749fac6 commit e714f9a

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:
2323

2424
```yml
2525
dependencies:
26-
dart_appwrite: ^0.3.1
26+
dart_appwrite: ^0.4.0
2727
```
2828
2929
You can install packages from the command line:
@@ -32,6 +32,7 @@ You can install packages from the command line:
3232
pub get dart_appwrite
3333
```
3434

35+
3536
## Contribution
3637

3738
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/client.dart

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Client {
1313

1414
this.headers = {
1515
'content-type': 'application/json',
16-
'x-sdk-version': 'appwrite:dart:0.3.1',
16+
'x-sdk-version': 'appwrite:dart:0.4.0',
1717
};
1818

1919
this.config = {};
@@ -102,6 +102,14 @@ class Client {
102102
if(e.response == null) {
103103
throw AppwriteException(e.message);
104104
}
105+
if(responseType == ResponseType.bytes) {
106+
if(e.response.headers['content-type'].contains('application/json')) {
107+
final res = json.decode(utf8.decode(e.response.data));
108+
throw AppwriteException(res['message'],res['code'], e.response);
109+
} else {
110+
throw AppwriteException(e.message);
111+
}
112+
}
105113
throw AppwriteException(e.response.data['message'],e.response.data['code'], e.response.data);
106114
} catch(e) {
107115
throw AppwriteException(e.message);

lib/dart_appwrite.dart

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
library dart_appwrite;
22

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

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: dart_appwrite
2-
version: 0.3.1
2+
version: 0.4.0
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-dart

0 commit comments

Comments
 (0)