Skip to content

Commit 24dd99b

Browse files
committed
Fix oauth
1 parent e5236a1 commit 24dd99b

File tree

14 files changed

+148
-7
lines changed

14 files changed

+148
-7
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 2 additions & 2 deletions
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: ^8.2.0
24+
appwrite: ^8.2.1
2525
```
2626
2727
You can install packages from the command line:
@@ -91,7 +91,7 @@ For web in order to capture the OAuth2 callback URL and send it to the applicati
9191
close the window.
9292
<script>
9393
window.opener.postMessage({
94-
'flutter-web-auth-2': window.___location.href
94+
flutter-web-auth-2: window.___location.href
9595
}, window.___location.origin);
9696
window.close();
9797
</script>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Functions functions = Functions(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = functions.retryBuild(
12+
functionId: '[FUNCTION_ID]',
13+
deploymentId: '[DEPLOYMENT_ID]',
14+
buildId: '[BUILD_ID]',
15+
);
16+
17+
result
18+
.then((response) {
19+
print(response);
20+
}).catchError((error) {
21+
print(error.response);
22+
});
23+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Graphql graphql = Graphql(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = graphql.63a0228e7e93a(
12+
query: '[QUERY]',
13+
);
14+
15+
result
16+
.then((response) {
17+
print(response);
18+
}).catchError((error) {
19+
print(error.response);
20+
});
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Graphql graphql = Graphql(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = graphql.63a025ceb6ac4(
12+
query: '[QUERY]',
13+
);
14+
15+
result
16+
.then((response) {
17+
print(response);
18+
}).catchError((error) {
19+
print(error.response);
20+
});
21+
}

docs/examples/graphql/get.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Graphql graphql = Graphql(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = graphql.get(
12+
query: '[QUERY]',
13+
);
14+
15+
result
16+
.then((response) {
17+
print(response);
18+
}).catchError((error) {
19+
print(error.response);
20+
});
21+
}

lib/id.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
part of appwrite;
22

33
class ID {
4+
ID._();
5+
46
static String unique() {
57
return 'unique()';
68
}

lib/permission.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
part of appwrite;
22

33
class Permission {
4+
Permission._();
5+
46
static String read(String role) {
57
return 'read("$role")';
68
}

lib/query.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
part of appwrite;
22

33
class Query {
4+
Query._();
5+
46
static equal(String attribute, dynamic value) =>
57
_addQuery(attribute, 'equal', value);
68

lib/role.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
part of appwrite;
22

33
class Role {
4+
Role._();
5+
46
static String any() {
57
return 'any';
68
}

0 commit comments

Comments
 (0)