Skip to content

Commit c5d1956

Browse files
committed
Add order random
1 parent f644d26 commit c5d1956

File tree

151 files changed

+6680
-6941
lines changed

Some content is hidden

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

151 files changed

+6680
-6941
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

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/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.8.x.
3+
/// This SDK is compatible with Appwrite server version 1.8.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/query.dart

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ class Query {
1010

1111
Map<String, dynamic> toJson() {
1212
final result = <String, dynamic>{};
13-
13+
1414
result['method'] = method;
15-
16-
if (attribute != null) {
15+
16+
if(attribute != null) {
1717
result['attribute'] = attribute;
1818
}
19-
20-
if (values != null) {
19+
20+
if(values != null) {
2121
result['values'] = values is List ? values : [values];
2222
}
2323

@@ -28,7 +28,7 @@ class Query {
2828
String toString() => jsonEncode(toJson());
2929

3030
/// Filter resources where [attribute] is equal to [value].
31-
///
31+
///
3232
/// [value] can be a single value or a list. If a list is used
3333
/// the query will return resources where [attribute] is equal
3434
/// to any of the values in the list.
@@ -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,15 +153,19 @@ class Query {
153153
static String orderDesc(String attribute) =>
154154
Query._('orderDesc', attribute).toString();
155155

156+
/// Sort results randomly.
157+
static String orderRandom() =>
158+
Query._('orderRandom').toString();
159+
156160
/// Return results before [id].
157-
///
161+
///
158162
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
159163
/// docs for more information.
160164
static String cursorBefore(String id) =>
161165
Query._('cursorBefore', null, id).toString();
162166

163167
/// Return results after [id].
164-
///
168+
///
165169
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
166170
/// docs for more information.
167171
static String cursorAfter(String id) =>
@@ -171,43 +175,27 @@ class Query {
171175
static String limit(int limit) => Query._('limit', null, limit).toString();
172176

173177
/// Return results from [offset].
174-
///
178+
///
175179
/// Refer to the [Offset Pagination](https://appwrite.io/docs/pagination#offset-pagination)
176180
/// docs for more information.
177181
static String offset(int offset) =>
178182
Query._('offset', null, offset).toString();
179183

180184
/// Filter resources where [attribute] is at a specific distance from the given coordinates.
181-
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+
static String distanceEqual(String attribute, List<dynamic> values, num distance, [bool meters = true]) =>
186+
Query._('distanceEqual', attribute, [[values, distance, meters]]).toString();
187187

188188
/// Filter resources where [attribute] is not at a specific distance from the given coordinates.
189-
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();
189+
static String distanceNotEqual(String attribute, List<dynamic> values, num distance, [bool meters = true]) =>
190+
Query._('distanceNotEqual', attribute, [[values, distance, meters]]).toString();
195191

196192
/// Filter resources where [attribute] is at a distance greater than the specified value from the given coordinates.
197-
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();
193+
static String distanceGreaterThan(String attribute, List<dynamic> values, num distance, [bool meters = true]) =>
194+
Query._('distanceGreaterThan', attribute, [[values, distance, meters]]).toString();
203195

204196
/// Filter resources where [attribute] is at a distance less than the specified value from the given coordinates.
205-
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();
197+
static String distanceLessThan(String attribute, List<dynamic> values, num distance, [bool meters = true]) =>
198+
Query._('distanceLessThan', attribute, [[values, distance, meters]]).toString();
211199

212200
/// Filter resources where [attribute] intersects with the given geometry.
213201
static String intersects(String attribute, List<dynamic> values) =>
@@ -240,4 +228,4 @@ class Query {
240228
/// Filter resources where [attribute] does not touch the given geometry.
241229
static String notTouches(String attribute, List<dynamic> values) =>
242230
Query._('notTouches', attribute, [values]).toString();
243-
}
231+
}

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ class Role {
6363
static String label(String name) {
6464
return 'label:$name';
6565
}
66-
}
66+
}

0 commit comments

Comments
 (0)