Flutter
Parse SDK (REST)
Install Parse SDK
9 min
introduction in this guide, you will learn how to get started with back4app for your flutter project using the flutter plugin for parse server prerequisites to complete this tutorial, you will need an app created on back4app flutter version 3 3 x or later https //flutter dev/docs/get started/install android studio https //developer android com/studio or vs code installed (with plugins dart and flutter) 1\ install parse sdk open your computer's cmd or terminal (depending on your operating system) and go into your flutter projects directory run this command to create a new flutter app launch your flutter app by running this command add the parse sdk to your project dependencies running this command will flutter get and add the parse sdk to your pubspec yaml pubspec yaml file 2\ set up parse sdk the next step is to import the parse sdk inside your project's main dart main dart file inside main dart main dart , you can use import 'package\ parse server sdk flutter/parse server sdk flutter dart'; initialize your parse app go to main dart main dart , and initialize parse in your flutter app 1 void main() async { 2 const keyapplicationid = 'your app id here'; 3 const keyclientkey = 'your client key here'; 4 const keyparseserverurl = 'https //parseapi back4app com'; 5 6 await parse() initialize(keyapplicationid, keyparseserverurl, 7 clientkey keyclientkey, debug true); 8 } note the debug debug parameter in function parse() initialize parse() initialize is set to true true , to allow displaying parse api calls on the console this configuration can assist in debugging the code it is advisable to disable debug in the release version to successfully connect your app to the back4app servers, you must provide parse sdk with your backend application credentials update the string values with your application id and client key locate your application id and client key credentials by navigating to your app dashboard > app settings > security & keys image of the backend app id copy these credentials and replace in main dart main dart keyapplicationid = app id keyclientkey = client key 3\ test your parse connection you should test the sdk to verify that parse and your backend is working with your flutter application it will create an object on your project called first class let’s add the test code to main dart main dart as follows 1 void main() async { 2 final keyapplicationid = 'your app id here'; 3 final keyclientkey = 'your client key here'; 4 final keyparseserverurl = 'https //parseapi back4app com'; 5 6 await parse() initialize(keyapplicationid, keyparseserverurl, 7 clientkey keyclientkey, autosendsessionid true); 8 9 var firstobject = parseobject('firstclass') 10 set( 11 'message', 'hey, parse is now connected!🙂'); 12 await firstobject save(); 13 14 print('done'); 15 } launch your app and go to the back4app website https //www back4app com/ find your app and navigate to the dashboard now go to database > browser > first class you should see the first class with an object, as shown in the image below image of a new class object created in the backend you're done! now you know exactly how to get started using back4app you learned how to install the parse sdk in your flutter application and connect to your back4app backend