Skip to content

Commit 7733a1f

Browse files
committed
fix file input and examples
1 parent 879dd29 commit 7733a1f

17 files changed

+27
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.0.1
2+
* Fix InputFile filename param
3+
* Fix examples
4+
15
## 4.0.0
26
* Support for Appwrite 0.13
37
* **BREAKING** **Tags** have been renamed to **Deployments**

README.md

Lines changed: 1 addition & 1 deletion
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: ^4.0.0
26+
dart_appwrite: ^4.0.1
2727
```
2828
2929
You can install packages from the command line:

docs/examples/functions/create-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void main() { // Init SDK
1313
Future result = functions.createDeployment(
1414
functionId: '[FUNCTION_ID]',
1515
entrypoint: '[ENTRYPOINT]',
16-
code: await MultipartFile.fromPath('code', './path-to-files/image.jpg', 'image.jpg'),
16+
code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'),
1717
activate: false,
1818
);
1919

docs/examples/storage/create-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void main() { // Init SDK
1414
Future result = storage.createFile(
1515
bucketId: '[BUCKET_ID]',
1616
fileId: '[FILE_ID]',
17-
file: await MultipartFile.fromPath('file', './path-to-files/image.jpg', 'image.jpg'),
17+
file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'),
1818
);
1919

2020
result

lib/services/account.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
part of dart_appwrite;
22

3+
/// The Account service allows you to authenticate and manage a user account.
34
class Account extends Service {
45
Account(Client client): super(client);
56

lib/services/avatars.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
part of dart_appwrite;
22

3+
/// The Avatars service aims to help you complete everyday tasks related to
4+
/// your app image, icons, and avatars.
35
class Avatars extends Service {
46
Avatars(Client client): super(client);
57

lib/services/database.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
part of dart_appwrite;
22

3+
/// The Database service allows you to create structured collections of
4+
/// documents, query and filter lists of documents
35
class Database extends Service {
46
Database(Client client): super(client);
57

lib/services/functions.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
part of dart_appwrite;
22

3+
/// The Functions Service allows you view, create and manage your Cloud
4+
/// Functions.
35
class Functions extends Service {
46
Functions(Client client): super(client);
57

lib/services/health.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
part of dart_appwrite;
22

3+
/// The Health service allows you to both validate and monitor your Appwrite
4+
/// server's health.
35
class Health extends Service {
46
Health(Client client): super(client);
57

lib/services/locale.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
part of dart_appwrite;
22

3+
/// The Locale service allows you to customize your app based on your users'
4+
/// location.
35
class Locale extends Service {
46
Locale(Client client): super(client);
57

lib/services/storage.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
part of dart_appwrite;
22

3+
/// The Storage service allows you to manage your project files.
34
class Storage extends Service {
45
Storage(Client client): super(client);
56

lib/services/teams.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
part of dart_appwrite;
22

3+
/// The Teams service allows you to group users of your project and to enable
4+
/// them to share read and write access to your project resources
35
class Teams extends Service {
46
Teams(Client client): super(client);
57

lib/services/users.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
part of dart_appwrite;
22

3+
/// The Users service allows you to manage your project users.
34
class Users extends Service {
45
Users(Client client): super(client);
56

lib/src/chunked_upload_io.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Future<Response> chunkedUpload({
2626

2727
late Response res;
2828
if (size <= Client.CHUNK_SIZE) {
29-
params[paramName] = await http.MultipartFile.fromPath(paramName, file.path!, filename: file.fileName);
29+
params[paramName] = await http.MultipartFile.fromPath(paramName, file.path!, filename: file.filename);
3030
return client.call(
3131
HttpMethod.post,
3232
path: path,
@@ -55,7 +55,7 @@ Future<Response> chunkedUpload({
5555
raf.setPositionSync(offset);
5656
final chunk = raf.readSync(Client.CHUNK_SIZE);
5757
params[paramName] =
58-
http.MultipartFile.fromBytes(paramName, chunk, filename: file.fileName);
58+
http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename);
5959
headers['content-range'] =
6060
'bytes $offset-${min<int>(((offset + Client.CHUNK_SIZE) - 1), size)}/$size';
6161
res = await client.call(HttpMethod.post,

lib/src/client_browser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
2626
_httpClient = BrowserClient();
2727
_headers = {
2828
'content-type': 'application/json',
29-
'x-sdk-version': 'appwrite:dart:4.0.0',
29+
'x-sdk-version': 'appwrite:dart:4.0.1',
3030
'X-Appwrite-Response-Format' : '0.13.0',
3131
};
3232

lib/src/client_io.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ClientIO extends ClientBase with ClientMixin {
3535
_endPoint = endPoint;
3636
_headers = {
3737
'content-type': 'application/json',
38-
'x-sdk-version': 'appwrite:dart:4.0.0',
38+
'x-sdk-version': 'appwrite:dart:4.0.1',
3939
'X-Appwrite-Response-Format' : '0.13.0',
4040
};
4141

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: dart_appwrite
2-
version: 4.0.0
2+
version: 4.0.1
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)