Merge pull request #970 from lohanidamodar/feat-dart-sdk-getting-started
feat-dart-sdk-getting-started
This commit is contained in:
commit
76e54de739
4 changed files with 79 additions and 54 deletions
|
@ -67,6 +67,8 @@ $cli
|
|||
$target = \realpath(__DIR__.'/..').'/sdks/git/'.$language['key'].'/';
|
||||
$readme = \realpath(__DIR__ . '/../../docs/sdks/'.$language['key'].'/README.md');
|
||||
$readme = ($readme) ? \file_get_contents($readme) : '';
|
||||
$gettingStarted = \realpath(__DIR__ . '/../../docs/sdks/'.$language['key'].'/GETTING_STARTED.md');
|
||||
$gettingStarted = ($gettingStarted) ? \file_get_contents($gettingStarted) : '';
|
||||
$examples = \realpath(__DIR__ . '/../../docs/sdks/'.$language['key'].'/EXAMPLES.md');
|
||||
$examples = ($examples) ? \file_get_contents($examples) : '';
|
||||
$changelog = \realpath(__DIR__ . '/../../docs/sdks/'.$language['key'].'/CHANGELOG.md');
|
||||
|
@ -187,6 +189,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
->setShareVia('appwrite_io')
|
||||
->setWarning($warning)
|
||||
->setReadme($readme)
|
||||
->setGettingStarted($gettingStarted)
|
||||
->setChangelog($changelog)
|
||||
->setExamples($examples)
|
||||
;
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
"slickdeals/statsd": "~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"appwrite/sdk-generator": "0.6.2",
|
||||
"appwrite/sdk-generator": "0.6.3",
|
||||
"phpunit/phpunit": "9.4.2",
|
||||
"swoole/ide-helper": "4.5.5",
|
||||
"vimeo/psalm": "4.1.1"
|
||||
|
|
97
composer.lock
generated
97
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "442d6d8b6c76ef7ae5ea26e500af6479",
|
||||
"content-hash": "a328295b2b11cf89bbae0f3a8d9143ee",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
@ -466,12 +466,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/promises.git",
|
||||
"reference": "ddfeedfff2a52661429437da0702979f708e6ac6"
|
||||
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/ddfeedfff2a52661429437da0702979f708e6ac6",
|
||||
"reference": "ddfeedfff2a52661429437da0702979f708e6ac6",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
|
||||
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -512,9 +512,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/promises/issues",
|
||||
"source": "https://github.com/guzzle/promises/tree/master"
|
||||
"source": "https://github.com/guzzle/promises/tree/1.4.1"
|
||||
},
|
||||
"time": "2020-10-19T16:50:15+00:00"
|
||||
"time": "2021-03-07T09:25:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
|
@ -522,12 +522,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "2f3e4f6cf8fd4aad7624c90a94f0ab38fde25976"
|
||||
"reference": "64245c4a03d43ddb638c4ff0b2d330c2af726ec5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/2f3e4f6cf8fd4aad7624c90a94f0ab38fde25976",
|
||||
"reference": "2f3e4f6cf8fd4aad7624c90a94f0ab38fde25976",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/64245c4a03d43ddb638c4ff0b2d330c2af726ec5",
|
||||
"reference": "64245c4a03d43ddb638c4ff0b2d330c2af726ec5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -589,7 +589,7 @@
|
|||
"issues": "https://github.com/guzzle/psr7/issues",
|
||||
"source": "https://github.com/guzzle/psr7/tree/1.x"
|
||||
},
|
||||
"time": "2021-03-02T18:57:24+00:00"
|
||||
"time": "2021-03-07T16:17:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "influxdb/influxdb-php",
|
||||
|
@ -2063,20 +2063,20 @@
|
|||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
"version": "dev-master",
|
||||
"version": "1.9.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webmozarts/assert.git",
|
||||
"reference": "4631e2c7d2d7132adac9fd84d4c1a98c10a6e049"
|
||||
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/webmozarts/assert/zipball/4631e2c7d2d7132adac9fd84d4c1a98c10a6e049",
|
||||
"reference": "4631e2c7d2d7132adac9fd84d4c1a98c10a6e049",
|
||||
"url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
|
||||
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2 || ^8.0",
|
||||
"php": "^5.3.3 || ^7.0 || ^8.0",
|
||||
"symfony/polyfill-ctype": "^1.8"
|
||||
},
|
||||
"conflict": {
|
||||
|
@ -2084,15 +2084,9 @@
|
|||
"vimeo/psalm": "<3.9.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5.13"
|
||||
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.10-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webmozart\\Assert\\": "src/"
|
||||
|
@ -2116,9 +2110,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/webmozarts/assert/issues",
|
||||
"source": "https://github.com/webmozarts/assert/tree/master"
|
||||
"source": "https://github.com/webmozarts/assert/tree/1.9.1"
|
||||
},
|
||||
"time": "2021-02-28T20:01:57+00:00"
|
||||
"time": "2020-07-08T17:02:28+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
|
@ -2292,11 +2286,11 @@
|
|||
},
|
||||
{
|
||||
"name": "appwrite/sdk-generator",
|
||||
"version": "0.6.2",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator",
|
||||
"reference": "d96376295c9265a054634d21dcdbfc02b832c677"
|
||||
"reference": "583248c57c5bcbd9c74f8312cc7fc3ab6cda51a3"
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
|
@ -2309,6 +2303,7 @@
|
|||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.0"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -2326,7 +2321,7 @@
|
|||
}
|
||||
],
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"time": "2021-03-03T12:53:32+00:00"
|
||||
"time": "2021-03-07T08:45:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/package-versions-deprecated",
|
||||
|
@ -3277,12 +3272,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
||||
"reference": "e3324ecbde7319b0bbcf0fd7ca4af19469c38da9"
|
||||
"reference": "f8d350d8514ff60b5993dd0121c62299480c989c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e3324ecbde7319b0bbcf0fd7ca4af19469c38da9",
|
||||
"reference": "e3324ecbde7319b0bbcf0fd7ca4af19469c38da9",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f8d350d8514ff60b5993dd0121c62299480c989c",
|
||||
"reference": "f8d350d8514ff60b5993dd0121c62299480c989c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3326,7 +3321,7 @@
|
|||
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
|
||||
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
|
||||
},
|
||||
"time": "2020-11-18T14:27:38+00:00"
|
||||
"time": "2021-03-07T11:12:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/type-resolver",
|
||||
|
@ -3872,28 +3867,22 @@
|
|||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
"version": "dev-master",
|
||||
"version": "1.1.x-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/container.git",
|
||||
"reference": "381524e8568e07f31d504a945b88556548c8c42e"
|
||||
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/381524e8568e07f31d504a945b88556548c8c42e",
|
||||
"reference": "381524e8568e07f31d504a945b88556548c8c42e",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
|
||||
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.0"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Container\\": "src/"
|
||||
|
@ -3920,9 +3909,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-fig/container/issues",
|
||||
"source": "https://github.com/php-fig/container/tree/master"
|
||||
"source": "https://github.com/php-fig/container/tree/1.1.x"
|
||||
},
|
||||
"time": "2020-10-13T07:07:53+00:00"
|
||||
"time": "2021-03-05T17:36:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
|
@ -4944,12 +4933,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "c08d7d0d458eceb62996d81d3be8d9fbf5564ec4"
|
||||
"reference": "92e1b7c4381c3c51e327b99c7ff067411e291783"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/c08d7d0d458eceb62996d81d3be8d9fbf5564ec4",
|
||||
"reference": "c08d7d0d458eceb62996d81d3be8d9fbf5564ec4",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/92e1b7c4381c3c51e327b99c7ff067411e291783",
|
||||
"reference": "92e1b7c4381c3c51e327b99c7ff067411e291783",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -5034,7 +5023,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-02-23T10:10:15+00:00"
|
||||
"time": "2021-03-06T13:50:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-grapheme",
|
||||
|
@ -5454,17 +5443,17 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/service-contracts.git",
|
||||
"reference": "e830e6ceebd6377b019e4c9a523d6f2c27007e4a"
|
||||
"reference": "96cd360b9f03a22a30cf5354e630c557bd3aac33"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/e830e6ceebd6377b019e4c9a523d6f2c27007e4a",
|
||||
"reference": "e830e6ceebd6377b019e4c9a523d6f2c27007e4a",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/96cd360b9f03a22a30cf5354e630c557bd3aac33",
|
||||
"reference": "96cd360b9f03a22a30cf5354e630c557bd3aac33",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"psr/container": "^1.0"
|
||||
"psr/container": "^1.1"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/service-implementation": ""
|
||||
|
@ -5526,7 +5515,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-02-25T16:38:04+00:00"
|
||||
"time": "2021-03-05T22:51:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
|
@ -5900,7 +5889,9 @@
|
|||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": [],
|
||||
"stability-flags": {
|
||||
"appwrite/sdk-generator": 20
|
||||
},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
|
|
31
docs/sdks/dart/GETTING_STARTED.md
Normal file
31
docs/sdks/dart/GETTING_STARTED.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
## Getting Started
|
||||
|
||||
### Initialize & Make API Request
|
||||
Once you add the dependencies, its extremely easy to get started with the SDK; All you need to do is import the package in your code, set your Appwrite credentials, and start making API calls. Below is a simple example:
|
||||
|
||||
```dart
|
||||
import 'package:dart_appwrite/dart_appwrite.dart';
|
||||
|
||||
void main() async {
|
||||
Client client = Client();
|
||||
.setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible
|
||||
.setProject('5ff3379a01d25') // Your project ID
|
||||
.setKey('cd868c7af8bdc893b4...93b7535db89')
|
||||
|
||||
Users users = Users(client);
|
||||
|
||||
try {
|
||||
final response = await users.create(email: ‘email@example.com’,password: ‘password’, name: ‘name’);
|
||||
print(response.data);
|
||||
} on AppwriteException catch(e) {
|
||||
print(e.message);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Learn more
|
||||
You can use followng resources to learn more and get help
|
||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||
- 🚂 [Appwrite Dart Playground](https://github.com/appwrite/playground-for-dart)
|
Loading…
Reference in a new issue