Search code examples
flutteribm-cloudchatbotibm-watsonwatson-assistant

IBM Watson Assistant in Flutter: How to show options?


I created an IBM Watson Assistant chatbot, and a flutter app. I'm using the package watson_assistant_v2. My bot returns response options. How do I show them visually?

I'm using the package example and I didn't find anything about it.

In Watson Assistant, defining the options:

Assistant responds

Preview, showing the options:

Assistant preview

My app, not showing options:

On app


Solution

  • Response options are encoded in the JSON structure which Watson Assistant returns. You can see the options here as part of the API definition. The documentation for Watson Assistant discusses receiving an option response as part of implementing option responses.

    You need to decode the response and show the options as clickable UI element.