DEV Community

Amey Sunu
Amey Sunu

Posted on

Integrating with Flutter is a NLP engine by Facebook that allows users to convert statements into a queried structural data hence allowing developers to build conversational applications such as chatbots.


To get started you can simply visit and login with your existing Facebook account. You can also make the use of amazing documentation provided by the team.


  • To add to your Flutter app, simply install the flutter_witai package from

  • Now create a wit object and set it to the WitManager class from the package, which consists of 2 parameters namely utterance, headers.

final wit = WitManager(utterance: "hello",headers: "XXXXXXXXXX");
Enter fullscreen mode Exit fullscreen mode

Utterance will be your query statement for which you'd be creating a structured data response and headers will be the project SERVER ACCESS TOKEN which can be found in the settings.

  • Call the fetchLink() function to trigger the function and get the structured JSON response based on whatever utterance query you mentioned.
Enter fullscreen mode Exit fullscreen mode
  • You can view the results by printing out the json to the console, by setting the fetchLink() function to a dynamic variable
dynamic response = await wit.fetchLink();
Enter fullscreen mode Exit fullscreen mode

The response should look somewhat like this:


Enter fullscreen mode Exit fullscreen mode
  • You can now get any values from the response json, such as entities, traits or any such values.
Enter fullscreen mode Exit fullscreen mode

It's that simple. You can create any Flutter button such as TextButton and then simply call the function within it's onPressed parameter to call the function. Also remember to use the async keyword for asynchronous operations.

You can also take a look at the example code written in the package.

Top comments (2)

pablonax profile image
Pablo Discobar

Good job! If you are interested in this topic, you can also look at my article about free vs paid Flutter templates. I'm sure you'll find something useful there, too.  -

ameysunu profile image
Amey Sunu

Nice work! I really can make use of some of these templates, thanks! :)