Skip to content

Commit dce521a

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

8 files changed

Lines changed: 56 additions & 57 deletions

lib/query.dart

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -160,26 +160,26 @@ class Query {
160160
between('\$updatedAt', start, end);
161161

162162
static String or(List<String> queries) => Query._(
163-
'or',
164-
null,
165-
queries.map((query) => jsonDecode(query)).toList(),
166-
).toString();
163+
'or',
164+
null,
165+
queries.map((query) => jsonDecode(query)).toList(),
166+
).toString();
167167

168168
static String and(List<String> queries) => Query._(
169-
'and',
170-
null,
171-
queries.map((query) => jsonDecode(query)).toList(),
172-
).toString();
169+
'and',
170+
null,
171+
queries.map((query) => jsonDecode(query)).toList(),
172+
).toString();
173173

174174
/// Filter array elements where at least one element matches all the specified queries.
175175
///
176176
/// [attribute] The attribute containing the array to filter on.
177177
/// [queries] The list of query strings to match against array elements.
178178
static String elemMatch(String attribute, List<String> queries) => Query._(
179-
'elemMatch',
180-
attribute,
181-
queries.map((query) => jsonDecode(query)).toList(),
182-
).toString();
179+
'elemMatch',
180+
attribute,
181+
queries.map((query) => jsonDecode(query)).toList(),
182+
).toString();
183183

184184
/// Specify which attributes should be returned by the API call.
185185
static String select(List<String> attributes) =>
@@ -226,39 +226,43 @@ class Query {
226226
List<dynamic> values,
227227
num distance, [
228228
bool meters = true,
229-
]) => Query._('distanceEqual', attribute, [
230-
[values, distance, meters],
231-
]).toString();
229+
]) =>
230+
Query._('distanceEqual', attribute, [
231+
[values, distance, meters],
232+
]).toString();
232233

233234
/// Filter resources where [attribute] is not at a specific distance from the given coordinates.
234235
static String distanceNotEqual(
235236
String attribute,
236237
List<dynamic> values,
237238
num distance, [
238239
bool meters = true,
239-
]) => Query._('distanceNotEqual', attribute, [
240-
[values, distance, meters],
241-
]).toString();
240+
]) =>
241+
Query._('distanceNotEqual', attribute, [
242+
[values, distance, meters],
243+
]).toString();
242244

243245
/// Filter resources where [attribute] is at a distance greater than the specified value from the given coordinates.
244246
static String distanceGreaterThan(
245247
String attribute,
246248
List<dynamic> values,
247249
num distance, [
248250
bool meters = true,
249-
]) => Query._('distanceGreaterThan', attribute, [
250-
[values, distance, meters],
251-
]).toString();
251+
]) =>
252+
Query._('distanceGreaterThan', attribute, [
253+
[values, distance, meters],
254+
]).toString();
252255

253256
/// Filter resources where [attribute] is at a distance less than the specified value from the given coordinates.
254257
static String distanceLessThan(
255258
String attribute,
256259
List<dynamic> values,
257260
num distance, [
258261
bool meters = true,
259-
]) => Query._('distanceLessThan', attribute, [
260-
[values, distance, meters],
261-
]).toString();
262+
]) =>
263+
Query._('distanceLessThan', attribute, [
264+
[values, distance, meters],
265+
]).toString();
262266

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

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/client_io.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,8 @@ class ClientIO extends ClientBase with ClientMixin {
429429

430430
var nextChunk = 0;
431431
Future<void> uploadNext() async {
432-
final raf = file.bytes == null
433-
? await iofile!.open(mode: FileMode.read)
434-
: null;
432+
final raf =
433+
file.bytes == null ? await iofile!.open(mode: FileMode.read) : null;
435434
try {
436435
while (nextChunk < chunks.length) {
437436
final chunk = chunks[nextChunk++];

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class RealtimeIO extends RealtimeBase with RealtimeMixin {
7979
var client = HttpClient(context: SecurityContext());
8080
client.badCertificateCallback =
8181
(X509Certificate cert, String host, int port) {
82-
return true;
83-
};
82+
return true;
83+
};
8484

8585
uri = Uri(
8686
scheme: uri.scheme == 'wss' ? 'https' : 'http',

lib/src/realtime_mixin.dart

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ mixin RealtimeMixin {
141141
final message = RealtimeMessage.fromMap(messageData);
142142
final subscriptions =
143143
(messageData['subscriptions'] as List<dynamic>?)
144-
?.map((x) => x.toString())
145-
.toList() ??
146-
<String>[];
144+
?.map((x) => x.toString())
145+
.toList() ??
146+
<String>[];
147147

148148
if (subscriptions.isEmpty) {
149149
break;
@@ -201,10 +201,10 @@ mixin RealtimeMixin {
201201
return _retries < 5
202202
? 1
203203
: _retries < 15
204-
? 5
205-
: _retries < 100
206-
? 10
207-
: 60;
204+
? 5
205+
: _retries < 100
206+
? 10
207+
: 60;
208208
}
209209

210210
Uri _prepareUri() {
@@ -322,10 +322,8 @@ mixin RealtimeMixin {
322322
List<String> queries = const [],
323323
]) {
324324
StreamController<RealtimeMessage> controller = StreamController.broadcast();
325-
final channelStrings = channels
326-
.map((ch) => _channelToString(ch))
327-
.toList()
328-
.cast<String>();
325+
final channelStrings =
326+
channels.map((ch) => _channelToString(ch)).toList().cast<String>();
329327
final queryStrings = List<String>.from(queries);
330328

331329
final subscriptionId = _generateUniqueSubscriptionId();
@@ -348,10 +346,8 @@ mixin RealtimeMixin {
348346
return;
349347
}
350348
if (channels != null) {
351-
final nextChannels = channels
352-
.map((ch) => _channelToString(ch))
353-
.toList()
354-
.cast<String>();
349+
final nextChannels =
350+
channels.map((ch) => _channelToString(ch)).toList().cast<String>();
355351
current.channels
356352
..clear()
357353
..addAll(nextChannels);

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+
);

lib/src/realtime_subscription.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RealtimeSubscription {
2121

2222
/// Replace the channels and/or queries on this subscription without recreating it.
2323
final Future<void> Function({List<Object>? channels, List<String>? queries})
24-
update;
24+
update;
2525

2626
/// Alias of [unsubscribe] that also closes the socket when this was the last active
2727
/// subscription. Prefer [unsubscribe] plus [Realtime.disconnect] for explicit control.

0 commit comments

Comments
 (0)