Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tests #157

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
flutter tests
  • Loading branch information
lohanidamodar committed Jun 21, 2023
commit 9e624dae20a40fcaa3b46ae9ecc7378226cc5087
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

[![pub package](https://img.shields.io/pub/v/appwrite?style=flat-square)](https://pub.dartlang.org/packages/appwrite)
![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-0.13.x-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.3.x-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 0.13.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
**This SDK is compatible with Appwrite server version 1.3.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand Down
22 changes: 22 additions & 0 deletions docs/examples/account/create-email-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createEmailSession(
email: '[email protected]',
password: 'password',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
22 changes: 22 additions & 0 deletions docs/examples/account/create-phone-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createPhoneSession(
userId: '[USER_ID]',
phone: '+12065550100',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
19 changes: 19 additions & 0 deletions docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createPhoneVerification();

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
2 changes: 1 addition & 1 deletion docs/examples/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void main() { // Init SDK
Future result = account.create(
userId: '[USER_ID]',
email: '[email protected]',
password: 'password',
password: '',
);

result
Expand Down
20 changes: 20 additions & 0 deletions docs/examples/account/list-logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.listLogs(
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
19 changes: 19 additions & 0 deletions docs/examples/account/list-sessions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.listSessions();

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
2 changes: 1 addition & 1 deletion docs/examples/account/update-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void main() { // Init SDK
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updatePassword(
password: 'password',
password: '',
);

result
Expand Down
22 changes: 22 additions & 0 deletions docs/examples/account/update-phone-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updatePhoneSession(
userId: '[USER_ID]',
secret: '[SECRET]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
22 changes: 22 additions & 0 deletions docs/examples/account/update-phone-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updatePhoneVerification(
userId: '[USER_ID]',
secret: '[SECRET]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
22 changes: 22 additions & 0 deletions docs/examples/account/update-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updatePhone(
phone: '+12065550100',
password: 'password',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
19 changes: 19 additions & 0 deletions docs/examples/account/update-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateStatus();

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
24 changes: 24 additions & 0 deletions docs/examples/databases/create-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Databases databases = Databases(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = databases.createDocument(
databaseId: '[DATABASE_ID]',
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
data: {},
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
23 changes: 23 additions & 0 deletions docs/examples/databases/delete-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Databases databases = Databases(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = databases.deleteDocument(
databaseId: '[DATABASE_ID]',
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
23 changes: 23 additions & 0 deletions docs/examples/databases/get-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Databases databases = Databases(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = databases.getDocument(
databaseId: '[DATABASE_ID]',
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
22 changes: 22 additions & 0 deletions docs/examples/databases/list-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Databases databases = Databases(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = databases.listDocuments(
databaseId: '[DATABASE_ID]',
collectionId: '[COLLECTION_ID]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
23 changes: 23 additions & 0 deletions docs/examples/databases/update-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Databases databases = Databases(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = databases.updateDocument(
databaseId: '[DATABASE_ID]',
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
21 changes: 21 additions & 0 deletions docs/examples/graphql/mutation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Graphql graphql = Graphql(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = graphql.mutation(
query: {},
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
21 changes: 21 additions & 0 deletions docs/examples/graphql/query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
Client client = Client();
Graphql graphql = Graphql(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = graphql.query(
query: {},
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
Loading