Skip to content

Commit ef08ff7

Browse files
Merge pull request #308 from appwrite/dev
feat: SDK update for version 24.0.0
2 parents 4608354 + b3f435f commit ef08ff7

15 files changed

Lines changed: 209 additions & 117 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## 24.0.0
4+
5+
* Breaking: Added `unsubscribe()`, `update()`, and `close()` for Realtime subscription lifecycle.
6+
* Added: Added `userPhone` to the `Membership` model.
7+
* Updated: Updated `X-Appwrite-Response-Format` header to `1.9.2`.
8+
39
## 23.1.0
410

511
* Added `x` OAuth provider to `OAuthProvider` enum

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Add this to your package's `pubspec.yaml` file:
1919

2020
```yml
2121
dependencies:
22-
appwrite: ^23.1.0
22+
appwrite: ^24.0.0
2323
```
2424
2525
You can install packages from the command line:

lib/src/client_browser.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class ClientBrowser extends ClientBase with ClientMixin {
4040
'x-sdk-name': 'Flutter',
4141
'x-sdk-platform': 'client',
4242
'x-sdk-language': 'flutter',
43-
'x-sdk-version': '23.1.0',
44-
'X-Appwrite-Response-Format': '1.9.1',
43+
'x-sdk-version': '24.0.0',
44+
'X-Appwrite-Response-Format': '1.9.2',
4545
};
4646

4747
config = {};

lib/src/client_io.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class ClientIO extends ClientBase with ClientMixin {
5858
'x-sdk-name': 'Flutter',
5959
'x-sdk-platform': 'client',
6060
'x-sdk-language': 'flutter',
61-
'x-sdk-version': '23.1.0',
62-
'X-Appwrite-Response-Format': '1.9.1',
61+
'x-sdk-version': '24.0.0',
62+
'X-Appwrite-Response-Format': '1.9.2',
6363
};
6464

6565
config = {};

lib/src/models/membership.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class Membership implements Model {
2020
/// User email address. Hide this attribute by toggling membership privacy in the Console.
2121
final String userEmail;
2222

23+
/// User phone number. Hide this attribute by toggling membership privacy in the Console.
24+
final String userPhone;
25+
2326
/// Team ID.
2427
final String teamId;
2528

@@ -48,6 +51,7 @@ class Membership implements Model {
4851
required this.userId,
4952
required this.userName,
5053
required this.userEmail,
54+
required this.userPhone,
5155
required this.teamId,
5256
required this.teamName,
5357
required this.invited,
@@ -65,6 +69,7 @@ class Membership implements Model {
6569
userId: map['userId'].toString(),
6670
userName: map['userName'].toString(),
6771
userEmail: map['userEmail'].toString(),
72+
userPhone: map['userPhone'].toString(),
6873
teamId: map['teamId'].toString(),
6974
teamName: map['teamName'].toString(),
7075
invited: map['invited'].toString(),
@@ -84,6 +89,7 @@ class Membership implements Model {
8489
"userId": userId,
8590
"userName": userName,
8691
"userEmail": userEmail,
92+
"userPhone": userPhone,
8793
"teamId": teamId,
8894
"teamName": teamName,
8995
"invited": invited,

lib/src/realtime.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ abstract class Realtime extends Service {
5555
List<String> queries = const [],
5656
}); // Object can be String or Channel<T>
5757

58+
/// Close the WebSocket connection and drop all active subscriptions client-side.
59+
/// Use this instead of calling [RealtimeSubscription.unsubscribe] on every
60+
/// subscription when you want to tear everything down.
61+
Future<void> disconnect();
62+
5863
/// The [close code](https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5) set when the WebSocket connection is closed.
5964
///
6065
/// Before the connection has been closed, this will be `null`.

lib/src/realtime_base.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ abstract class RealtimeBase implements Realtime {
77
List<Object> channels, {
88
List<String> queries = const [],
99
}); // Object can be String or Channel<T>
10+
11+
@override
12+
Future<void> disconnect();
1013
}

0 commit comments

Comments
 (0)