Flutter is a free and open-source mobile UI framework that has been gaining a lot of popularity. It is created by Google and was unveiled at the 2015 Dart developer summit. Some of the advantages of using Flutter are:
Build cross-platform apps - It allows the building of cross-platform apps from a single code base. This means you can now target Android and iOS using a single codebase.
Hot reload - The Hot reload feature allows you to quickly reload the code on a running app as and when you make code changes.
Faster rendering - Flutter uses the Skia library, the same rendering library as the Chrome browser which makes rendering faster.
In this post, we will see how we can use our Headless CMS to power the contents for your apps. To get started, you first need to include the Dialogue Wise package like this:
Next, we need to prepare the payload and its pretty straight forward.
var request = new DialogueWiseRequest();
request.slug = '[Your Slug]';
request.apiKey = '[Your API Key]';
request.emailHash='[The hash of your email]';
Now that you have the payload ready, all you need to do is to call the service with the payload.
var dialogueWiseService = new DialogueWiseService(new HttpClient());
Map response = await dialogueWiseService.getDialogue(request);
You can now run the command pub dev to resolve all the dependencies and then run dart main.dart where main.dart is the file containing your code.
That’s it! You now have your content in the response variable and you just need to display it on your app.