Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

docs.flutter.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.

Learn more

Flutter 3.41 is live! Check out theFlutter 3.41 blog post!

User experience

How the user will experience the AI Toolkit in your app.

TheLlmChatView widget is the entry point for the interactive chat experience that AI Toolkit provides. Hosting an instance of theLlmChatView enables a number of user experience features that don't require any additional code to use:

  • Multiline text input: Allows users to paste long text input or insert new lines into their text as they enter it.
  • Voice input: Allows users to input prompts using speech for ease of use.
  • Multimedia input: Enables users to take pictures, send images and other file types and attach URLs as link to online resources.
  • Image zoom: Enables users to zoom into image thumbnails.
  • Copy to clipboard: Allows the user to copy the text of a message or a LLM response to the clipboard.
  • Message editing: Allows the user to edit the most recent message for resubmission to the LLM.
  • Material and Cupertino: Adapts to the best practices of both design languages.

Multiline text input

#

The user has options when it comes to submitting their prompt once they've finished composing it, which again differs depending on their platform:

  • Mobile: Tap theSubmit button
  • Web: PressEnter or tap theSubmit button
  • Desktop: PressEnter or tap theSubmit button

In addition, the chat view supports text prompts with embedded newlines in them. If the user has existing text with newlines, they can paste them into the prompt text field as normal.

If they'd like to embed newlines into their prompt manually as they enter it, they can do so. The gesture for that activity differs based on the platform they're using:

  • Mobile: Tap Return key on the virtual keyboard
  • Web: PressShift+Enter
  • Desktop: PressShift+Enter

These options look like the following:

Web and Desktop:

Screenshot of entering text ondesktop

Mobile:

Screenshot of entering text onmobile

Voice input

#

In addition to text input the chat view can take an audio recording as input by tapping the Mic button, which is visible when no text has yet been entered.

Tap theMic button to start the recording:

Screenshot of enteringtext

Select theStop button to translate the user's voice input into text:

This text can then be edited, augmented and submitted as normal.

Screenshot of enteredvoice

Multimedia input

#

Textfield containing "Testing, testing, one, two,three"

The chat view can also take images and files as input to pass along to the underlying LLM. The user can select thePlus button to the left of the text input and choose from theTake Photo,Image Gallery,Attach File andAttach Link icons:

Screenshot of the 4icons

TheTake Photo button allows the user to use their device's camera to take a photo:

Selfie image

Select theImage Gallery button to let the user upload from their device's image gallery:

Download image fromgallery

Select theAttach File button to let the user select a file of any type available on their device, like a PDF or TXT file.

Select theAttach Link button to let the user enter a link to a web page or an online file.

Once a photo, image, file, or link has been selected, it becomes an attachment and shows up as a thumbnail associated with the currently active prompt:

Thumbnails of images

The user can remove an attachment by clicking theX button on the thumbnail.

Image zoom

#

The user can zoom into an image thumbnail by tapping it:

Zoomed image

Pressing theEsc key or tapping anywhere outside the image dismisses the zoomed image.

Copy to clipboard

#

The user can copy any text prompt or LLM response in their current chat in a variety of ways. On the desktop or the web, the user can mouse to select the text on their screen and copy it to the clipboard as normal:

Copy to clipboard

In addition, at the bottom of each prompt or response, the user can select theCopy button that pops up when they hover their mouse:

Select the copy button

On mobile platforms, the user can long-tap a prompt or response and choose the Copy option:

Long tap to see the copybutton

Message editing

#

If the user would like to edit their last prompt and cause the LLM to take another run at it, they can do so. On the desktop, the user can tap theEdit button alongside theCopy button for their most recent prompt:

How to edit prompt

On a mobile device, the user can long-tap and get access to theEdit option on their most recent prompt:

How to access editmenu

Once the user taps theEdit button, they enter Editing mode, which removes both the user's last prompt and the LLM's last response from the chat history, puts the text of the prompt into the text field, and provides an Editing indicator:

How to exit editingmode

In Editing mode, the user can edit the prompt as they choose and submit it to have the LLM produce a response as normal. Or, if they change their mind, they can tap theX near the Editing indicator to cancel their edit and restore their previous LLM response.

Material and Cupertino

#

When theLlmChatView widget is hosted in aMaterial app, it uses facilities provided by the Material design language, such as Material'sTextField. Likewise, when hosted in aCupertino app, it uses those facilities, such asCupertinoTextField.

Cupertino example app

However, while the chat view supports both the Material and Cupertino app types, it doesn't automatically adopt the associated themes. Instead, that's set by thestyle property of theLlmChatView as described in theCustom styling documentation.

Was this page's content helpful?

Unless stated otherwise, the documentation on this site reflects Flutter 3.38.6. Page last updated on 2026-01-07.View source orreport an issue.


[8]ページ先頭

©2009-2026 Movatter.jp