Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ on:
jobs:
format:
runs-on: ubuntu-latest
container:
image: dart:stable

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
ref: ${{ github.event.pull_request.head.ref }}

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: Install dependencies
run: flutter pub get

- name: Format Dart code
run: dart format .
Expand All @@ -29,5 +35,5 @@ jobs:
- name: Add & Commit
uses: EndBug/add-and-commit@v9.1.4
with:
add: lib
add: '["lib", "test"]'

16 changes: 8 additions & 8 deletions lib/query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ class Query {
Query._('updatedAfter', null, value).toString();

static String or(List<String> queries) => Query._(
'or',
null,
queries.map((query) => jsonDecode(query)).toList(),
).toString();
'or',
null,
queries.map((query) => jsonDecode(query)).toList(),
).toString();

static String and(List<String> queries) => Query._(
'and',
null,
queries.map((query) => jsonDecode(query)).toList(),
).toString();
'and',
null,
queries.map((query) => jsonDecode(query)).toList(),
).toString();

/// Specify which attributes should be returned by the API call.
static String select(List<String> attributes) =>
Expand Down
2 changes: 0 additions & 2 deletions lib/services/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,6 @@ class Account extends Service {
'success': success,
'failure': failure,
'scopes': scopes,

'project': client.config['project'],
};

Expand Down Expand Up @@ -1299,7 +1298,6 @@ class Account extends Service {
'success': success,
'failure': failure,
'scopes': scopes,

'project': client.config['project'],
};

Expand Down
7 changes: 0 additions & 7 deletions lib/services/avatars.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Avatars extends Service {
'width': width,
'height': height,
'quality': quality,

'project': client.config['project'],
};

Expand Down Expand Up @@ -68,7 +67,6 @@ class Avatars extends Service {
'width': width,
'height': height,
'quality': quality,

'project': client.config['project'],
};

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

final Map<String, dynamic> params = {
'url': url,

'project': client.config['project'],
};

Expand Down Expand Up @@ -128,7 +125,6 @@ class Avatars extends Service {
'width': width,
'height': height,
'quality': quality,

'project': client.config['project'],
};

Expand Down Expand Up @@ -163,7 +159,6 @@ class Avatars extends Service {
'url': url,
'width': width,
'height': height,

'project': client.config['project'],
};

Expand Down Expand Up @@ -205,7 +200,6 @@ class Avatars extends Service {
'width': width,
'height': height,
'background': background,

'project': client.config['project'],
};

Expand Down Expand Up @@ -234,7 +228,6 @@ class Avatars extends Service {
'size': size,
'margin': margin,
'download': download,

'project': client.config['project'],
};

Expand Down
3 changes: 0 additions & 3 deletions lib/services/storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ class Storage extends Service {

final Map<String, dynamic> params = {
'token': token,

'project': client.config['project'],
};

Expand Down Expand Up @@ -228,7 +227,6 @@ class Storage extends Service {
'background': background,
'output': output?.value,
'token': token,

'project': client.config['project'],
};

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

final Map<String, dynamic> params = {
'token': token,

'project': client.config['project'],
};

Expand Down
3 changes: 2 additions & 1 deletion lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ abstract class Client {
factory Client({
String endPoint = 'https://cloud.appwrite.io/v1',
bool selfSigned = false,
}) => createClient(endPoint: endPoint, selfSigned: selfSigned);
}) =>
createClient(endPoint: endPoint, selfSigned: selfSigned);

/// Handle OAuth2 session creation.
Future webAuth(Uri url, {String? callbackUrlScheme});
Expand Down
17 changes: 8 additions & 9 deletions lib/src/cookie_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ class CookieManager extends Interceptor {
await cookieJar
.loadForRequest(Uri(scheme: request.url.scheme, host: request.url.host))
.then((cookies) {
var cookie = getCookies(cookies);
if (cookie.isNotEmpty) {
request.headers.addAll({HttpHeaders.cookieHeader: cookie});
}
return request;
})
.catchError((e, stackTrace) {
return request;
});
var cookie = getCookies(cookies);
if (cookie.isNotEmpty) {
request.headers.addAll({HttpHeaders.cookieHeader: cookie});
}
return request;
}).catchError((e, stackTrace) {
return request;
});
return request;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/realtime_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class RealtimeIO extends RealtimeBase with RealtimeMixin {
var client = HttpClient(context: SecurityContext());
client.badCertificateCallback =
(X509Certificate cert, String host, int port) {
debugPrint('AppwriteRealtime: Allow self-signed certificate');
return true;
};
debugPrint('AppwriteRealtime: Allow self-signed certificate');
return true;
};

uri = Uri(
scheme: uri.scheme == 'wss' ? 'https' : 'http',
Expand Down
8 changes: 4 additions & 4 deletions lib/src/realtime_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ mixin RealtimeMixin {
return _retries < 5
? 1
: _retries < 15
? 5
: _retries < 100
? 10
: 60;
? 5
: _retries < 100
? 10
: 60;
}

Uri _prepareUri() {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/realtime_stub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import 'client.dart';

/// Implemented in `realtime_browser.dart` and `realtime_io.dart`.
RealtimeBase createRealtime(Client client) => throw UnsupportedError(
'Cannot create a client without dart:html or dart:io.',
);
'Cannot create a client without dart:html or dart:io.',
);
1 change: 0 additions & 1 deletion test/query_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,3 @@ void main() {
expect(query['method'], 'updatedAfter');
});
}

Loading