File tree Expand file tree Collapse file tree 13 files changed +40
-11
lines changed Expand file tree Collapse file tree 13 files changed +40
-11
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
21
21
22
22
``` yml
23
23
dependencies :
24
- appwrite : ^13.1.0
24
+ appwrite : ^13.1.1
25
25
` ` `
26
26
27
27
You can install packages from the command line:
Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ abstract class Client {
76
76
/// Add headers that should be sent with all API calls.
77
77
Client addHeader (String key, String value);
78
78
79
+ /// Sends a "ping" request to Appwrite to verify connectivity.
80
+ Future <String > ping ();
81
+
79
82
/// Send the API request.
80
83
Future <Response > call (
81
84
HttpMethod method, {
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ abstract class ClientBase implements Client {
29
29
@override
30
30
ClientBase addHeader (String key, String value);
31
31
32
+ @override
33
+ Future <String > ping ();
34
+
32
35
@override
33
36
Future <Response > call (
34
37
HttpMethod method, {
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
43
43
'x-sdk-name' : 'Flutter' ,
44
44
'x-sdk-platform' : 'client' ,
45
45
'x-sdk-language' : 'flutter' ,
46
- 'x-sdk-version' : '13.1.0 ' ,
46
+ 'x-sdk-version' : '13.1.1 ' ,
47
47
'X-Appwrite-Response-Format' : '1.6.0' ,
48
48
};
49
49
@@ -115,6 +115,15 @@ class ClientBrowser extends ClientBase with ClientMixin {
115
115
return this ;
116
116
}
117
117
118
+ @override
119
+ Future <String > ping () async {
120
+ final String apiPath = '/ping' ;
121
+ final response = await call (HttpMethod .get ,
122
+ path: apiPath, responseType: ResponseType .plain);
123
+
124
+ return response.data;
125
+ }
126
+
118
127
Future init () async {
119
128
final cookieFallback = web.window.localStorage['cookieFallback' ];
120
129
if (cookieFallback != null ) {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class ClientIO extends ClientBase with ClientMixin {
64
64
'x-sdk-name' : 'Flutter' ,
65
65
'x-sdk-platform' : 'client' ,
66
66
'x-sdk-language' : 'flutter' ,
67
- 'x-sdk-version' : '13.1.0 ' ,
67
+ 'x-sdk-version' : '13.1.1 ' ,
68
68
'X-Appwrite-Response-Format' : '1.6.0' ,
69
69
};
70
70
@@ -147,6 +147,15 @@ class ClientIO extends ClientBase with ClientMixin {
147
147
return this ;
148
148
}
149
149
150
+ @override
151
+ Future <String > ping () async {
152
+ final String apiPath = '/ping' ;
153
+ final response = await call (HttpMethod .get ,
154
+ path: apiPath, responseType: ResponseType .plain);
155
+
156
+ return response.data;
157
+ }
158
+
150
159
Future init () async {
151
160
if (_initProgress) return ;
152
161
_initProgress = true ;
Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ class Document implements Model {
38
38
$databaseId: map['\$ databaseId' ].toString (),
39
39
$createdAt: map['\$ createdAt' ].toString (),
40
40
$updatedAt: map['\$ updatedAt' ].toString (),
41
- $permissions: map['\$ permissions' ] ?? [],
41
+ $permissions: List <String >.from (
42
+ map['\$ permissions' ]? .map ((x) => x.toString ()) ?? []),
42
43
data: map,
43
44
);
44
45
}
Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ class Execution implements Model {
78
78
$id: map['\$ id' ].toString (),
79
79
$createdAt: map['\$ createdAt' ].toString (),
80
80
$updatedAt: map['\$ updatedAt' ].toString (),
81
- $permissions: map['\$ permissions' ] ?? [],
81
+ $permissions: List <String >.from (
82
+ map['\$ permissions' ]? .map ((x) => x.toString ()) ?? []),
82
83
functionId: map['functionId' ].toString (),
83
84
trigger: map['trigger' ].toString (),
84
85
status: map['status' ].toString (),
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ class File implements Model {
55
55
bucketId: map['bucketId' ].toString (),
56
56
$createdAt: map['\$ createdAt' ].toString (),
57
57
$updatedAt: map['\$ updatedAt' ].toString (),
58
- $permissions: map['\$ permissions' ] ?? [],
58
+ $permissions: List <String >.from (
59
+ map['\$ permissions' ]? .map ((x) => x.toString ()) ?? []),
59
60
name: map['name' ].toString (),
60
61
signature: map['signature' ].toString (),
61
62
mimeType: map['mimeType' ].toString (),
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class Membership implements Model {
71
71
joined: map['joined' ].toString (),
72
72
confirm: map['confirm' ],
73
73
mfa: map['mfa' ],
74
- roles: map['roles' ] ?? [],
74
+ roles: List < String >. from ( map['roles' ]? . map ((x) => x. toString ()) ?? []) ,
75
75
);
76
76
}
77
77
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ class MfaRecoveryCodes implements Model {
11
11
12
12
factory MfaRecoveryCodes .fromMap (Map <String , dynamic > map) {
13
13
return MfaRecoveryCodes (
14
- recoveryCodes: map['recoveryCodes' ] ?? [],
14
+ recoveryCodes: List <String >.from (
15
+ map['recoveryCodes' ]? .map ((x) => x.toString ()) ?? []),
15
16
);
16
17
}
17
18
You can’t perform that action at this time.
0 commit comments