Closed Tananga closed 2 years ago
Can you share the stack trace of what's not working??
This whole example section of code which is inside readme file is not a valid Dart code.
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
Thanks for help!
This issue has been fixed. You can close this now
@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()
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()
And ; at the end
yup- a typo
This issue should now be fixed. Feel free to reopen if you still have issues.
๐ 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?
๐ข Have you read the Code of Conduct?