Skip to content

Commit fbfde16

Browse files
implement realtime feature
1 parent 41fe5d2 commit fbfde16

35 files changed

+1366
-262
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
[![pub package](https://img.shields.io/pub/v/appwrite?style=flat-square)](https://pub.dartlang.org/packages/appwrite)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-0.9.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.10.0-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
99

10-
**This SDK is compatible with Appwrite server version 0.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
10+
**This SDK is compatible with Appwrite server version 0.10.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
1111

1212
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1313

@@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
2121

2222
```yml
2323
dependencies:
24-
appwrite: ^0.7.1
24+
appwrite: ^1.0.0
2525
```
2626
2727
You can install packages from the command line:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = account.createMagicURLSession(
12+
13+
);
14+
15+
result
16+
.then((response) {
17+
print(response);
18+
}).catchError((error) {
19+
print(error.response);
20+
});
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = account.updateMagicURLSession(
12+
userId: '[USER_ID]',
13+
secret: '[SECRET]',
14+
);
15+
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}

docs/examples/storage/create-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void main() { // Init SDK
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
;
1212
Future result = storage.createFile(
13-
file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'),
13+
file: await MultipartFile.fromPath('file', './path-to-files/image.jpg', 'image.jpg'),
1414
);
1515

1616
result

lib/appwrite.dart

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
library appwrite;
22

3-
import 'dart:io';
4-
import 'dart:convert';
5-
import 'package:shared_preferences/shared_preferences.dart';
6-
import 'package:universal_html/html.dart' as html;
7-
import 'package:dio/dio.dart';
3+
import 'dart:async';
4+
import 'package:http/http.dart' as http;
85
import 'package:flutter/foundation.dart';
9-
import 'package:flutter_web_auth/flutter_web_auth.dart';
10-
import 'package:dio/adapter.dart';
11-
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
12-
import 'package:cookie_jar/cookie_jar.dart';
13-
import 'package:path_provider/path_provider.dart';
14-
import 'package:package_info_plus/package_info_plus.dart';
15-
import 'package:device_info_plus/device_info_plus.dart';
6+
import 'src/redirect_stub.dart'
7+
if (dart.library.html) 'src/redirect_browser.dart';
8+
import 'src/enums.dart';
9+
import 'src/client.dart';
10+
import 'src/response.dart';
11+
import 'src/service.dart';
1612

17-
export 'package:dio/dio.dart' show Response, MultipartFile;
13+
export 'src/response.dart';
14+
export 'src/client.dart';
15+
export 'src/exception.dart';
16+
export 'src/realtime.dart';
17+
export 'src/realtime_subscription.dart';
18+
export 'package:http/http.dart' show MultipartFile;
1819

19-
part 'client.dart';
20-
part 'enums.dart';
21-
part 'service.dart';
22-
part 'exception.dart';
2320
part 'services/account.dart';
2421
part 'services/avatars.dart';
2522
part 'services/database.dart';

lib/client.dart

Lines changed: 0 additions & 199 deletions
This file was deleted.

lib/enums.dart

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)