Skip to content

Commit e061bca

Browse files
authored
Merge pull request #269 from appwrite/fix-missing-dependencies
fix: install dependencies so analysis options work during format
2 parents d1e9a39 + d8ced37 commit e061bca

Some content is hidden

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

70 files changed

+2696
-2926
lines changed

.github/workflows/format.yml

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

1614
steps:
1715
- name: Checkout repository
1816
uses: actions/checkout@v4
1917
with:
2018
persist-credentials: true
2119
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
2228

2329
- name: Format Dart code
2430
run: dart format .
@@ -29,5 +35,5 @@ jobs:
2935
- name: Add & Commit
3036
uses: EndBug/add-and-commit@v9.1.4
3137
with:
32-
add: lib
38+
add: '["lib", "test"]'
3339

lib/query.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,16 @@ class Query {
120120
Query._('updatedAfter', null, value).toString();
121121

122122
static String or(List<String> queries) => Query._(
123-
'or',
124-
null,
125-
queries.map((query) => jsonDecode(query)).toList(),
126-
).toString();
123+
'or',
124+
null,
125+
queries.map((query) => jsonDecode(query)).toList(),
126+
).toString();
127127

128128
static String and(List<String> queries) => Query._(
129-
'and',
130-
null,
131-
queries.map((query) => jsonDecode(query)).toList(),
132-
).toString();
129+
'and',
130+
null,
131+
queries.map((query) => jsonDecode(query)).toList(),
132+
).toString();
133133

134134
/// Specify which attributes should be returned by the API call.
135135
static String select(List<String> attributes) =>

lib/services/account.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,6 @@ class Account extends Service {
942942
'success': success,
943943
'failure': failure,
944944
'scopes': scopes,
945-
946945
'project': client.config['project'],
947946
};
948947

@@ -1299,7 +1298,6 @@ class Account extends Service {
12991298
'success': success,
13001299
'failure': failure,
13011300
'scopes': scopes,
1302-
13031301
'project': client.config['project'],
13041302
};
13051303

lib/services/avatars.dart

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

@@ -68,7 +67,6 @@ class Avatars extends Service {
6867
'width': width,
6968
'height': height,
7069
'quality': quality,
71-
7270
'project': client.config['project'],
7371
};
7472

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

9189
final Map<String, dynamic> params = {
9290
'url': url,
93-
9491
'project': client.config['project'],
9592
};
9693

@@ -128,7 +125,6 @@ class Avatars extends Service {
128125
'width': width,
129126
'height': height,
130127
'quality': quality,
131-
132128
'project': client.config['project'],
133129
};
134130

@@ -163,7 +159,6 @@ class Avatars extends Service {
163159
'url': url,
164160
'width': width,
165161
'height': height,
166-
167162
'project': client.config['project'],
168163
};
169164

@@ -205,7 +200,6 @@ class Avatars extends Service {
205200
'width': width,
206201
'height': height,
207202
'background': background,
208-
209203
'project': client.config['project'],
210204
};
211205

@@ -234,7 +228,6 @@ class Avatars extends Service {
234228
'size': size,
235229
'margin': margin,
236230
'download': download,
237-
238231
'project': client.config['project'],
239232
};
240233

lib/services/storage.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ class Storage extends Service {
177177

178178
final Map<String, dynamic> params = {
179179
'token': token,
180-
181180
'project': client.config['project'],
182181
};
183182

@@ -228,7 +227,6 @@ class Storage extends Service {
228227
'background': background,
229228
'output': output?.value,
230229
'token': token,
231-
232230
'project': client.config['project'],
233231
};
234232

@@ -255,7 +253,6 @@ class Storage extends Service {
255253

256254
final Map<String, dynamic> params = {
257255
'token': token,
258-
259256
'project': client.config['project'],
260257
};
261258

lib/src/client.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ abstract class Client {
2727
factory Client({
2828
String endPoint = 'https://cloud.appwrite.io/v1',
2929
bool selfSigned = false,
30-
}) => createClient(endPoint: endPoint, selfSigned: selfSigned);
30+
}) =>
31+
createClient(endPoint: endPoint, selfSigned: selfSigned);
3132

3233
/// Handle OAuth2 session creation.
3334
Future webAuth(Uri url, {String? callbackUrlScheme});

lib/src/cookie_manager.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ class CookieManager extends Interceptor {
1515
await cookieJar
1616
.loadForRequest(Uri(scheme: request.url.scheme, host: request.url.host))
1717
.then((cookies) {
18-
var cookie = getCookies(cookies);
19-
if (cookie.isNotEmpty) {
20-
request.headers.addAll({HttpHeaders.cookieHeader: cookie});
21-
}
22-
return request;
23-
})
24-
.catchError((e, stackTrace) {
25-
return request;
26-
});
18+
var cookie = getCookies(cookies);
19+
if (cookie.isNotEmpty) {
20+
request.headers.addAll({HttpHeaders.cookieHeader: cookie});
21+
}
22+
return request;
23+
}).catchError((e, stackTrace) {
24+
return request;
25+
});
2726
return request;
2827
}
2928

lib/src/realtime_io.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ class RealtimeIO extends RealtimeBase with RealtimeMixin {
6161
var client = HttpClient(context: SecurityContext());
6262
client.badCertificateCallback =
6363
(X509Certificate cert, String host, int port) {
64-
debugPrint('AppwriteRealtime: Allow self-signed certificate');
65-
return true;
66-
};
64+
debugPrint('AppwriteRealtime: Allow self-signed certificate');
65+
return true;
66+
};
6767

6868
uri = Uri(
6969
scheme: uri.scheme == 'wss' ? 'https' : 'http',

lib/src/realtime_mixin.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ mixin RealtimeMixin {
146146
return _retries < 5
147147
? 1
148148
: _retries < 15
149-
? 5
150-
: _retries < 100
151-
? 10
152-
: 60;
149+
? 5
150+
: _retries < 100
151+
? 10
152+
: 60;
153153
}
154154

155155
Uri _prepareUri() {

lib/src/realtime_stub.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import 'client.dart';
33

44
/// Implemented in `realtime_browser.dart` and `realtime_io.dart`.
55
RealtimeBase createRealtime(Client client) => throw UnsupportedError(
6-
'Cannot create a client without dart:html or dart:io.',
7-
);
6+
'Cannot create a client without dart:html or dart:io.',
7+
);

0 commit comments

Comments
 (0)