Creating ChatMessage

The query from the user and the response from the agent can be thought of as two different parts of a single component. We will create two different containers for them and then add them inside a single unit called ChatMessage. This will ensure that each query, along with its answer, appears in the same order as they were input by the user. We will start by creating a stateful widget called ChatMessage inside a new dart file called chat_message.dart. The following image shows the division of a ChatMesage into a query and a response:

To create the UI of the screen, follow these steps:

  1. Create a container with some text ...

Get Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.