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:
2121
2222``` yml
2323dependencies :
24- appwrite : ^13.1.0
24+ appwrite : ^13.1.1
2525` ` `
2626
2727You can install packages from the command line:
Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ abstract class Client {
7676 /// Add headers that should be sent with all API calls.
7777 Client addHeader (String key, String value);
7878
79+ /// Sends a "ping" request to Appwrite to verify connectivity.
80+ Future <String > ping ();
81+
7982 /// Send the API request.
8083 Future <Response > call (
8184 HttpMethod method, {
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ abstract class ClientBase implements Client {
2929 @override
3030 ClientBase addHeader (String key, String value);
3131
32+ @override
33+ Future <String > ping ();
34+
3235 @override
3336 Future <Response > call (
3437 HttpMethod method, {
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
4343 'x-sdk-name' : 'Flutter' ,
4444 'x-sdk-platform' : 'client' ,
4545 'x-sdk-language' : 'flutter' ,
46- 'x-sdk-version' : '13.1.0 ' ,
46+ 'x-sdk-version' : '13.1.1 ' ,
4747 'X-Appwrite-Response-Format' : '1.6.0' ,
4848 };
4949
@@ -115,6 +115,15 @@ class ClientBrowser extends ClientBase with ClientMixin {
115115 return this ;
116116 }
117117
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+
118127 Future init () async {
119128 final cookieFallback = web.window.localStorage['cookieFallback' ];
120129 if (cookieFallback != null ) {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class ClientIO extends ClientBase with ClientMixin {
6464 'x-sdk-name' : 'Flutter' ,
6565 'x-sdk-platform' : 'client' ,
6666 'x-sdk-language' : 'flutter' ,
67- 'x-sdk-version' : '13.1.0 ' ,
67+ 'x-sdk-version' : '13.1.1 ' ,
6868 'X-Appwrite-Response-Format' : '1.6.0' ,
6969 };
7070
@@ -147,6 +147,15 @@ class ClientIO extends ClientBase with ClientMixin {
147147 return this ;
148148 }
149149
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+
150159 Future init () async {
151160 if (_initProgress) return ;
152161 _initProgress = true ;
Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ class Document implements Model {
3838 $databaseId: map['\$ databaseId' ].toString (),
3939 $createdAt: map['\$ createdAt' ].toString (),
4040 $updatedAt: map['\$ updatedAt' ].toString (),
41- $permissions: map['\$ permissions' ] ?? [],
41+ $permissions: List <String >.from (
42+ map['\$ permissions' ]? .map ((x) => x.toString ()) ?? []),
4243 data: map,
4344 );
4445 }
Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ class Execution implements Model {
7878 $id: map['\$ id' ].toString (),
7979 $createdAt: map['\$ createdAt' ].toString (),
8080 $updatedAt: map['\$ updatedAt' ].toString (),
81- $permissions: map['\$ permissions' ] ?? [],
81+ $permissions: List <String >.from (
82+ map['\$ permissions' ]? .map ((x) => x.toString ()) ?? []),
8283 functionId: map['functionId' ].toString (),
8384 trigger: map['trigger' ].toString (),
8485 status: map['status' ].toString (),
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ class File implements Model {
5555 bucketId: map['bucketId' ].toString (),
5656 $createdAt: map['\$ createdAt' ].toString (),
5757 $updatedAt: map['\$ updatedAt' ].toString (),
58- $permissions: map['\$ permissions' ] ?? [],
58+ $permissions: List <String >.from (
59+ map['\$ permissions' ]? .map ((x) => x.toString ()) ?? []),
5960 name: map['name' ].toString (),
6061 signature: map['signature' ].toString (),
6162 mimeType: map['mimeType' ].toString (),
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class Membership implements Model {
7171 joined: map['joined' ].toString (),
7272 confirm: map['confirm' ],
7373 mfa: map['mfa' ],
74- roles: map['roles' ] ?? [],
74+ roles: List < String >. from ( map['roles' ]? . map ((x) => x. toString ()) ?? []) ,
7575 );
7676 }
7777
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ class MfaRecoveryCodes implements Model {
1111
1212 factory MfaRecoveryCodes .fromMap (Map <String , dynamic > map) {
1313 return MfaRecoveryCodes (
14- recoveryCodes: map['recoveryCodes' ] ?? [],
14+ recoveryCodes: List <String >.from (
15+ map['recoveryCodes' ]? .map ((x) => x.toString ()) ?? []),
1516 );
1617 }
1718
You can’t perform that action at this time.
0 commit comments