Skip to content

Commit 222edda

Browse files
authored
Merge pull request #273 from appwrite/dev
feat: Flutter SDK update for version 19.1.0
2 parents 0651a31 + 0d6df9f commit 222edda

File tree

115 files changed

+3678
-3402
lines changed

Some content is hidden

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

115 files changed

+3678
-3402
lines changed

.github/workflows/format.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,15 @@ on:
1010
jobs:
1111
format:
1212
runs-on: ubuntu-latest
13+
container:
14+
image: dart:stable
1315

1416
steps:
1517
- name: Checkout repository
1618
uses: actions/checkout@v4
1719
with:
1820
persist-credentials: true
1921
ref: ${{ github.event.pull_request.head.ref }}
20-
21-
- name: Install Flutter
22-
uses: subosito/flutter-action@v2
23-
with:
24-
channel: stable
25-
26-
- name: Install dependencies
27-
run: flutter pub get
2822

2923
- name: Format Dart code
3024
run: dart format .
@@ -35,5 +29,5 @@ jobs:
3529
- name: Add & Commit
3630
uses: EndBug/add-and-commit@v9.1.4
3731
with:
38-
add: '["lib", "test"]'
32+
add: lib
3933

CHANGELOG.md

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

3+
## 19.1.0
4+
5+
* Add `orderRandom` query support
6+
37
## 19.0.0
48

59
* Rename `CreditCard` enum value `unionChinaPay` to `unionPay`

README.md

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

2222
```yml
2323
dependencies:
24-
appwrite: ^19.0.0
24+
appwrite: ^19.1.0
2525
```
2626
2727
You can install packages from the command line:

lib/query.dart

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ class Query {
130130
Query._('updatedBetween', null, [start, end]).toString();
131131

132132
static String or(List<String> queries) => Query._(
133-
'or',
134-
null,
135-
queries.map((query) => jsonDecode(query)).toList(),
136-
).toString();
133+
'or',
134+
null,
135+
queries.map((query) => jsonDecode(query)).toList(),
136+
).toString();
137137

138138
static String and(List<String> queries) => Query._(
139-
'and',
140-
null,
141-
queries.map((query) => jsonDecode(query)).toList(),
142-
).toString();
139+
'and',
140+
null,
141+
queries.map((query) => jsonDecode(query)).toList(),
142+
).toString();
143143

144144
/// Specify which attributes should be returned by the API call.
145145
static String select(List<String> attributes) =>
@@ -153,6 +153,9 @@ class Query {
153153
static String orderDesc(String attribute) =>
154154
Query._('orderDesc', attribute).toString();
155155

156+
/// Sort results randomly.
157+
static String orderRandom() => Query._('orderRandom').toString();
158+
156159
/// Return results before [id].
157160
///
158161
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
@@ -179,35 +182,43 @@ class Query {
179182

180183
/// Filter resources where [attribute] is at a specific distance from the given coordinates.
181184
static String distanceEqual(
182-
String attribute, List<dynamic> values, num distance,
183-
[bool meters = true]) =>
184-
Query._('distanceEqual', attribute, [
185-
[values, distance, meters]
186-
]).toString();
185+
String attribute,
186+
List<dynamic> values,
187+
num distance, [
188+
bool meters = true,
189+
]) => Query._('distanceEqual', attribute, [
190+
[values, distance, meters],
191+
]).toString();
187192

188193
/// Filter resources where [attribute] is not at a specific distance from the given coordinates.
189194
static String distanceNotEqual(
190-
String attribute, List<dynamic> values, num distance,
191-
[bool meters = true]) =>
192-
Query._('distanceNotEqual', attribute, [
193-
[values, distance, meters]
194-
]).toString();
195+
String attribute,
196+
List<dynamic> values,
197+
num distance, [
198+
bool meters = true,
199+
]) => Query._('distanceNotEqual', attribute, [
200+
[values, distance, meters],
201+
]).toString();
195202

196203
/// Filter resources where [attribute] is at a distance greater than the specified value from the given coordinates.
197204
static String distanceGreaterThan(
198-
String attribute, List<dynamic> values, num distance,
199-
[bool meters = true]) =>
200-
Query._('distanceGreaterThan', attribute, [
201-
[values, distance, meters]
202-
]).toString();
205+
String attribute,
206+
List<dynamic> values,
207+
num distance, [
208+
bool meters = true,
209+
]) => Query._('distanceGreaterThan', attribute, [
210+
[values, distance, meters],
211+
]).toString();
203212

204213
/// Filter resources where [attribute] is at a distance less than the specified value from the given coordinates.
205214
static String distanceLessThan(
206-
String attribute, List<dynamic> values, num distance,
207-
[bool meters = true]) =>
208-
Query._('distanceLessThan', attribute, [
209-
[values, distance, meters]
210-
]).toString();
215+
String attribute,
216+
List<dynamic> values,
217+
num distance, [
218+
bool meters = true,
219+
]) => Query._('distanceLessThan', attribute, [
220+
[values, distance, meters],
221+
]).toString();
211222

212223
/// Filter resources where [attribute] intersects with the given geometry.
213224
static String intersects(String attribute, List<dynamic> values) =>

lib/services/account.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,9 @@ class Account extends Service {
890890
/// Use this endpoint to create a session from token. Provide the **userId**
891891
/// and **secret** parameters from the successful response of authentication
892892
/// flows initiated by token creation. For example, magic URL and phone login.
893-
@Deprecated('This API has been deprecated.')
893+
@Deprecated(
894+
'This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.',
895+
)
894896
Future<models.Session> updateMagicURLSession({
895897
required String userId,
896898
required String secret,
@@ -942,6 +944,7 @@ class Account extends Service {
942944
'success': success,
943945
'failure': failure,
944946
'scopes': scopes,
947+
945948
'project': client.config['project'],
946949
};
947950

@@ -974,7 +977,9 @@ class Account extends Service {
974977
/// Use this endpoint to create a session from token. Provide the **userId**
975978
/// and **secret** parameters from the successful response of authentication
976979
/// flows initiated by token creation. For example, magic URL and phone login.
977-
@Deprecated('This API has been deprecated.')
980+
@Deprecated(
981+
'This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.',
982+
)
978983
Future<models.Session> updatePhoneSession({
979984
required String userId,
980985
required String secret,
@@ -1298,6 +1303,7 @@ class Account extends Service {
12981303
'success': success,
12991304
'failure': failure,
13001305
'scopes': scopes,
1306+
13011307
'project': client.config['project'],
13021308
};
13031309

lib/services/avatars.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Avatars extends Service {
3131
'width': width,
3232
'height': height,
3333
'quality': quality,
34+
3435
'project': client.config['project'],
3536
};
3637

@@ -67,6 +68,7 @@ class Avatars extends Service {
6768
'width': width,
6869
'height': height,
6970
'quality': quality,
71+
7072
'project': client.config['project'],
7173
};
7274

@@ -88,6 +90,7 @@ class Avatars extends Service {
8890

8991
final Map<String, dynamic> params = {
9092
'url': url,
93+
9194
'project': client.config['project'],
9295
};
9396

@@ -125,6 +128,7 @@ class Avatars extends Service {
125128
'width': width,
126129
'height': height,
127130
'quality': quality,
131+
128132
'project': client.config['project'],
129133
};
130134

@@ -159,6 +163,7 @@ class Avatars extends Service {
159163
'url': url,
160164
'width': width,
161165
'height': height,
166+
162167
'project': client.config['project'],
163168
};
164169

@@ -200,6 +205,7 @@ class Avatars extends Service {
200205
'width': width,
201206
'height': height,
202207
'background': background,
208+
203209
'project': client.config['project'],
204210
};
205211

@@ -228,6 +234,7 @@ class Avatars extends Service {
228234
'size': size,
229235
'margin': margin,
230236
'download': download,
237+
231238
'project': client.config['project'],
232239
};
233240

0 commit comments

Comments
 (0)