From 0548e4ffb48aef47222898faf49f05741e0d0742 Mon Sep 17 00:00:00 2001 From: 1995YogeshSharma Date: Thu, 14 Oct 2021 00:49:52 +0530 Subject: [PATCH] Changes added to getting started with flutter doc --- docs/sdks/flutter/GETTING_STARTED.md | 45 +++++++++++++++------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/docs/sdks/flutter/GETTING_STARTED.md b/docs/sdks/flutter/GETTING_STARTED.md index 28899ff18d..8ed1e19923 100644 --- a/docs/sdks/flutter/GETTING_STARTED.md +++ b/docs/sdks/flutter/GETTING_STARTED.md @@ -58,14 +58,16 @@ For **Windows** add your app name and package name, Your package n ```dart import 'package:appwrite/appwrite.dart'; -Client client = Client(); +void main() { + Client client = Client(); -client - .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint - .setProject('5e8cf4f46b5e8') // Your project ID - .setSelfSigned() // Use only on dev mode with a self-signed SSL cert -; + client + .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint + .setProject('5e8cf4f46b5e8') // Your project ID + .setSelfSigned() // Use only on dev mode with a self-signed SSL cert + ; +} ``` Before starting to send any API calls to your new Appwrite instance, make sure your Android or iOS emulators has network access to the Appwrite server hostname or IP address. @@ -91,25 +93,28 @@ Response user = await account ```dart import 'package:appwrite/appwrite.dart'; -Client client = Client(); + +void main() { + Client client = Client(); -client - .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint - .setProject('5e8cf4f46b5e8') // Your project ID - .setSelfSigned() // Use only on dev mode with a self-signed SSL cert - ; + client + .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint + .setProject('5e8cf4f46b5e8') // Your project ID + .setSelfSigned() // Use only on dev mode with a self-signed SSL cert + ; -// Register User -Account account = Account(client); + // Register User + Account account = Account(client); -Response user = await account - .create( - email: 'me@appwrite.io', - password: 'password', - name: 'My Name' - ); + Response user = await account + .create( + email: 'me@appwrite.io', + password: 'password', + name: 'My Name' + ); +} ``` ### Error Handling