Skip to content

Commit 6e2e60f

Browse files
committed
Commit from GitHub Actions (Format and push)
1 parent 6a403ee commit 6e2e60f

File tree

92 files changed

+5018
-4630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+5018
-4630
lines changed

lib/appwrite.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// Appwrite Flutter SDK
22
///
3-
/// This SDK is compatible with Appwrite server version 1.7.x.
3+
/// This SDK is compatible with Appwrite server version 1.7.x.
44
/// For older versions, please check
55
/// [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).
66
library appwrite;

lib/client_browser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export 'src/client_browser.dart';
1+
export 'src/client_browser.dart';

lib/client_io.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export 'src/client_io.dart';
1+
export 'src/client_io.dart';

lib/id.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ class ID {
1010
final now = DateTime.now();
1111
final sec = (now.millisecondsSinceEpoch / 1000).floor();
1212
final usec = now.microsecondsSinceEpoch - (sec * 1000000);
13-
return sec.toRadixString(16) +
14-
usec.toRadixString(16).padLeft(5, '0');
13+
return sec.toRadixString(16) + usec.toRadixString(16).padLeft(5, '0');
1514
}
1615

1716
// Generate a unique ID with padding to have a longer ID

lib/query.dart

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
part of 'appwrite.dart';
22

3-
43
/// Helper class to generate query strings.
54
class Query {
65
final String method;
@@ -10,15 +9,13 @@ class Query {
109
Query._(this.method, [this.attribute = null, this.values = null]);
1110

1211
Map<String, dynamic> toJson() {
13-
final map = <String, dynamic>{
14-
'method': method,
15-
};
12+
final map = <String, dynamic>{'method': method};
1613

17-
if(attribute != null) {
14+
if (attribute != null) {
1815
map['attribute'] = attribute;
1916
}
20-
21-
if(values != null) {
17+
18+
if (values != null) {
2219
map['values'] = values is List ? values : [values];
2320
}
2421

@@ -29,7 +26,7 @@ class Query {
2926
String toString() => jsonEncode(toJson());
3027

3128
/// Filter resources where [attribute] is equal to [value].
32-
///
29+
///
3330
/// [value] can be a single value or a list. If a list is used
3431
/// the query will return resources where [attribute] is equal
3532
/// to any of the values in the list.
@@ -61,10 +58,12 @@ class Query {
6158
Query._('search', attribute, value).toString();
6259

6360
/// Filter resources where [attribute] is null.
64-
static String isNull(String attribute) => Query._('isNull', attribute).toString();
61+
static String isNull(String attribute) =>
62+
Query._('isNull', attribute).toString();
6563

6664
/// Filter resources where [attribute] is not null.
67-
static String isNotNull(String attribute) => Query._('isNotNull', attribute).toString();
65+
static String isNotNull(String attribute) =>
66+
Query._('isNotNull', attribute).toString();
6867

6968
/// Filter resources where [attribute] is between [start] and [end] (inclusive).
7069
static String between(String attribute, dynamic start, dynamic end) =>
@@ -83,41 +82,51 @@ class Query {
8382
static String contains(String attribute, dynamic value) =>
8483
Query._('contains', attribute, value).toString();
8584

86-
static String or(List<String> queries) =>
87-
Query._('or', null, queries.map((query) => jsonDecode(query)).toList()).toString();
85+
static String or(List<String> queries) => Query._(
86+
'or',
87+
null,
88+
queries.map((query) => jsonDecode(query)).toList(),
89+
).toString();
8890

89-
static String and(List<String> queries) =>
90-
Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toString();
91+
static String and(List<String> queries) => Query._(
92+
'and',
93+
null,
94+
queries.map((query) => jsonDecode(query)).toList(),
95+
).toString();
9196

9297
/// Specify which attributes should be returned by the API call.
9398
static String select(List<String> attributes) =>
9499
Query._('select', null, attributes).toString();
95100

96101
/// Sort results by [attribute] ascending.
97-
static String orderAsc(String attribute) => Query._('orderAsc', attribute).toString();
102+
static String orderAsc(String attribute) =>
103+
Query._('orderAsc', attribute).toString();
98104

99105
/// Sort results by [attribute] descending.
100-
static String orderDesc(String attribute) => Query._('orderDesc', attribute).toString();
106+
static String orderDesc(String attribute) =>
107+
Query._('orderDesc', attribute).toString();
101108

102109
/// Return results before [id].
103-
///
110+
///
104111
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
105112
/// docs for more information.
106-
static String cursorBefore(String id) => Query._('cursorBefore', null, id).toString();
113+
static String cursorBefore(String id) =>
114+
Query._('cursorBefore', null, id).toString();
107115

108116
/// Return results after [id].
109-
///
117+
///
110118
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
111119
/// docs for more information.
112-
static String cursorAfter(String id) => Query._('cursorAfter', null, id).toString();
120+
static String cursorAfter(String id) =>
121+
Query._('cursorAfter', null, id).toString();
113122

114123
/// Return only [limit] results.
115124
static String limit(int limit) => Query._('limit', null, limit).toString();
116125

117126
/// Return results from [offset].
118-
///
127+
///
119128
/// Refer to the [Offset Pagination](https://appwrite.io/docs/pagination#offset-pagination)
120129
/// docs for more information.
121-
static String offset(int offset) => Query._('offset', null, offset).toString();
122-
123-
}
130+
static String offset(int offset) =>
131+
Query._('offset', null, offset).toString();
132+
}

lib/realtime_browser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export 'src/realtime_browser.dart';
1+
export 'src/realtime_browser.dart';

lib/realtime_io.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export 'src/realtime_io.dart';
1+
export 'src/realtime_io.dart';

lib/role.dart

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,65 @@ part of 'appwrite.dart';
22

33
/// Helper class to generate role strings for [Permission].
44
class Role {
5-
Role._();
6-
7-
/// Grants access to anyone.
8-
///
9-
/// This includes authenticated and unauthenticated users.
10-
static String any() {
11-
return 'any';
12-
}
5+
Role._();
136

14-
/// Grants access to a specific user by user ID.
15-
///
16-
/// You can optionally pass verified or unverified for
17-
/// [status] to target specific types of users.
18-
static String user(String id, [String status = '']) {
19-
if(status.isEmpty) {
20-
return 'user:$id';
21-
}
22-
return 'user:$id/$status';
23-
}
7+
/// Grants access to anyone.
8+
///
9+
/// This includes authenticated and unauthenticated users.
10+
static String any() {
11+
return 'any';
12+
}
2413

25-
/// Grants access to any authenticated or anonymous user.
26-
///
27-
/// You can optionally pass verified or unverified for
28-
/// [status] to target specific types of users.
29-
static String users([String status = '']) {
30-
if(status.isEmpty) {
31-
return 'users';
32-
}
33-
return 'users/$status';
14+
/// Grants access to a specific user by user ID.
15+
///
16+
/// You can optionally pass verified or unverified for
17+
/// [status] to target specific types of users.
18+
static String user(String id, [String status = '']) {
19+
if (status.isEmpty) {
20+
return 'user:$id';
3421
}
22+
return 'user:$id/$status';
23+
}
3524

36-
/// Grants access to any guest user without a session.
37-
///
38-
/// Authenticated users don't have access to this role.
39-
static String guests() {
40-
return 'guests';
25+
/// Grants access to any authenticated or anonymous user.
26+
///
27+
/// You can optionally pass verified or unverified for
28+
/// [status] to target specific types of users.
29+
static String users([String status = '']) {
30+
if (status.isEmpty) {
31+
return 'users';
4132
}
33+
return 'users/$status';
34+
}
4235

43-
/// Grants access to a team by team ID.
44-
///
45-
/// You can optionally pass a role for [role] to target
46-
/// team members with the specified role.
47-
static String team(String id, [String role = '']) {
48-
if(role.isEmpty) {
49-
return 'team:$id';
50-
}
51-
return 'team:$id/$role';
52-
}
36+
/// Grants access to any guest user without a session.
37+
///
38+
/// Authenticated users don't have access to this role.
39+
static String guests() {
40+
return 'guests';
41+
}
5342

54-
/// Grants access to a specific member of a team.
55-
///
56-
/// When the member is removed from the team, they will
57-
/// no longer have access.
58-
static String member(String id) {
59-
return 'member:$id';
43+
/// Grants access to a team by team ID.
44+
///
45+
/// You can optionally pass a role for [role] to target
46+
/// team members with the specified role.
47+
static String team(String id, [String role = '']) {
48+
if (role.isEmpty) {
49+
return 'team:$id';
6050
}
51+
return 'team:$id/$role';
52+
}
6153

62-
/// Grants access to a user with the specified label.
63-
static String label(String name) {
64-
return 'label:$name';
65-
}
66-
}
54+
/// Grants access to a specific member of a team.
55+
///
56+
/// When the member is removed from the team, they will
57+
/// no longer have access.
58+
static String member(String id) {
59+
return 'member:$id';
60+
}
61+
62+
/// Grants access to a user with the specified label.
63+
static String label(String name) {
64+
return 'label:$name';
65+
}
66+
}

0 commit comments

Comments
 (0)