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

🐛 Bug Report: Getting Started in https://github.com/appwrite/sdk-for-dart contains a lot of bugs #21

Closed
2 tasks done
Tananga opened this issue May 24, 2022 · 10 comments
Labels
bug Something isn't working waiting for release

Comments

@Tananga
Copy link

Tananga commented May 24, 2022

👟 Reproduction steps

Open https://github.com/appwrite/sdk-for-dart and scroll to get started section. This code have a lot of bugs and its not valid dart code

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')
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert

Users users = Users(client);

try {
final response = await users.create(userId: '[USER_ID]', email: ‘email@example.com’,password: ‘password’, name: ‘name’);
print(response.data);
} on AppwriteException catch(e) {
print(e.message);
}
}

👍 Expected behavior

It should work

👎 Actual Behavior

It doesnt work

🎲 Appwrite version

Version 0.10.x

💻 Operating system

MacOS

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@Tananga Tananga added the bug Something isn't working label May 24, 2022
@2002Bishwajeet
Copy link

Can you share the stack trace of what's not working??

@Tananga
Copy link
Author

Tananga commented May 24, 2022

This whole example section of code which is inside readme file is not a valid Dart code.

@2002Bishwajeet
Copy link

Okay, I see what's the issue.
it should be

Client client = Client()
.setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible
.setProject('5ff3379a01d25') // Your project ID
.setKey('cd868c7af8bdc893b4...93b7535db89')
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert

and not the one's in readme. I will drop a PR for this soon.

Till that time, I would recommend follow from the appwrite docs

@Tananga
Copy link
Author

Tananga commented May 24, 2022

Thanks for help!

@2002Bishwajeet
Copy link

This issue has been fixed. You can close this now

@Tananga
Copy link
Author

Tananga commented Jun 4, 2022

@2002Bishwajeet This code is still not valid.

Client client = Client();
.setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible
.setProject('5ff3379a01d25') // Your project ID
.setKey('cd868c7af8bdc893b4...93b7535db89')
.setSelfSigned()

@2002Bishwajeet
Copy link

Client client = Client(); --> There should be no semi-colon
.setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible
.setProject('5ff3379a01d25') // Your project ID
.setKey('cd868c7af8bdc893b4...93b7535db89')
.setSelfSigned()

@Tananga
Copy link
Author

Tananga commented Jun 4, 2022

And ; at the end

@2002Bishwajeet
Copy link

yup- a typo

@lohanidamodar
Copy link
Member

This issue should now be fixed. Feel free to reopen if you still have issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for release
Projects
None yet
Development

No branches or pull requests

3 participants