Skip to content

Commit 695640d

Browse files
authored
Merge pull request #202 from appwrite/dev
fix: minor bugs
2 parents 932f1d6 + c0dce1c commit 695640d

Some content is hidden

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

91 files changed

+4892
-4508
lines changed

.github/workflows/format.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Format and push
2+
3+
# Github action will require permission to write to repo
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
format:
12+
runs-on: ubuntu-latest
13+
container:
14+
image: dart:stable
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
persist-credentials: true
21+
ref: ${{ github.event.pull_request.head.ref }}
22+
23+
- name: Format Dart code
24+
run: dart format .
25+
26+
- name: git config
27+
run: git config --global --add safe.directory /__w/sdk-for-flutter/sdk-for-flutter # required to fix dubious ownership
28+
29+
- name: Add & Commit
30+
uses: EndBug/[email protected]
31+
with:
32+
add: lib
33+

.github/workflows/publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Publish to pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+\.[0-9]+\.[0-9]+.*'
7+
8+
jobs:
9+
publish:
10+
permissions:
11+
id-token: write
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
13+
with:
14+
environment: pub.dev

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 12.0.4
2+
3+
* Fixed concurrent modification error when closing realtime socket
4+
15
## 12.0.3
26

37
* Upgrade dependencies

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: ^12.0.3
24+
appwrite: ^12.0.4
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.5.x.
3+
/// This SDK is compatible with Appwrite server version 1.5.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: 26 additions & 19 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;
@@ -14,11 +13,11 @@ class Query {
1413
'method': method,
1514
};
1615

17-
if(attribute != null) {
16+
if (attribute != null) {
1817
map['attribute'] = attribute;
1918
}
20-
21-
if(values != null) {
19+
20+
if (values != null) {
2221
map['values'] = values is List ? values : [values];
2322
}
2423

@@ -29,7 +28,7 @@ class Query {
2928
String toString() => jsonEncode(toJson());
3029

3130
/// Filter resources where [attribute] is equal to [value].
32-
///
31+
///
3332
/// [value] can be a single value or a list. If a list is used
3433
/// the query will return resources where [attribute] is equal
3534
/// to any of the values in the list.
@@ -61,10 +60,12 @@ class Query {
6160
Query._('search', attribute, value).toString();
6261

6362
/// Filter resources where [attribute] is null.
64-
static String isNull(String attribute) => Query._('isNull', attribute).toString();
63+
static String isNull(String attribute) =>
64+
Query._('isNull', attribute).toString();
6565

6666
/// Filter resources where [attribute] is not null.
67-
static String isNotNull(String attribute) => Query._('isNotNull', attribute).toString();
67+
static String isNotNull(String attribute) =>
68+
Query._('isNotNull', attribute).toString();
6869

6970
/// Filter resources where [attribute] is between [start] and [end] (inclusive).
7071
static String between(String attribute, dynamic start, dynamic end) =>
@@ -84,40 +85,46 @@ class Query {
8485
Query._('contains', attribute, value).toString();
8586

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

8991
static String and(List<String> queries) =>
90-
Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toString();
92+
Query._('and', null, queries.map((query) => jsonDecode(query)).toList())
93+
.toString();
9194

9295
/// Specify which attributes should be returned by the API call.
9396
static String select(List<String> attributes) =>
9497
Query._('select', null, attributes).toString();
9598

9699
/// Sort results by [attribute] ascending.
97-
static String orderAsc(String attribute) => Query._('orderAsc', attribute).toString();
100+
static String orderAsc(String attribute) =>
101+
Query._('orderAsc', attribute).toString();
98102

99103
/// Sort results by [attribute] descending.
100-
static String orderDesc(String attribute) => Query._('orderDesc', attribute).toString();
104+
static String orderDesc(String attribute) =>
105+
Query._('orderDesc', attribute).toString();
101106

102107
/// Return results before [id].
103-
///
108+
///
104109
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
105110
/// docs for more information.
106-
static String cursorBefore(String id) => Query._('cursorBefore', null, id).toString();
111+
static String cursorBefore(String id) =>
112+
Query._('cursorBefore', null, id).toString();
107113

108114
/// Return results after [id].
109-
///
115+
///
110116
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
111117
/// docs for more information.
112-
static String cursorAfter(String id) => Query._('cursorAfter', null, id).toString();
118+
static String cursorAfter(String id) =>
119+
Query._('cursorAfter', null, id).toString();
113120

114121
/// Return only [limit] results.
115122
static String limit(int limit) => Query._('limit', null, limit).toString();
116123

117124
/// Return results from [offset].
118-
///
125+
///
119126
/// Refer to the [Offset Pagination](https://appwrite.io/docs/pagination#offset-pagination)
120127
/// docs for more information.
121-
static String offset(int offset) => Query._('offset', null, offset).toString();
122-
123-
}
128+
static String offset(int offset) =>
129+
Query._('offset', null, offset).toString();
130+
}

0 commit comments

Comments
 (0)