AssistSuggestionSettings class

Represents the settings for assist message suggestions.

The AssistSuggestionSettings class used to store the customization details of the assist message suggestions, such as colors, padding, and text styles, etc.

Example:

List<AssistMessage> _messages = <AssistMessage>[
  AssistMessage.response(
    suggestionSettings: AssistSuggestionSettings(
      backgroundColor: Colors.grey[300],
      itemBackgroundColor: WidgetStateProperty.resolveWith<Color>(
        (states) {
          if (states.contains(WidgetState.hovered)) {
            return Colors.grey[400]!;
          }
          return Colors.grey;
        },
      ),
      shape: const RoundedRectangleBorder(
        borderRadius: BorderRadius.all(Radius.circular(4.0)),
      ),
      itemShape: WidgetStateProperty.resolveWith<ShapeBorder>(
          (Set<WidgetState> states) {
        if (states.contains(WidgetState.hovered)) {
          return RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(20),
          );
        }
        return RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(5),
        );
      }),
      padding: const EdgeInsets.only(top: 10, bottom: 10),
      itemPadding:
          const EdgeInsets.symmetric(horizontal: 12, vertical: 8.0),
      orientation: Orientation.portrait,
      runSpacing: 10.0,
      spacing: 10.0,
    ),
  ),
];

Constructors

AssistSuggestionSettings({Color? backgroundColor, WidgetStateProperty<Color?>? itemBackgroundColor, ShapeBorder? shape, WidgetStateProperty<ShapeBorder?>? itemShape, WidgetStateProperty<TextStyle?>? textStyle, EdgeInsetsGeometry padding = const EdgeInsetsDirectional.symmetric(vertical: 5.0), EdgeInsetsGeometry itemPadding = const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), Axis orientation = Axis.horizontal, AssistSuggestionOverflow itemOverflow = AssistSuggestionOverflow.wrap, AssistSuggestionSelectionType selectionType = AssistSuggestionSelectionType.single, double runSpacing = 12.0, double spacing = 16.0})
const

Properties

backgroundColor Color?
The backgroundColor property sets the background color for the suggestion area.
final
hashCode int
The hash code for this object.
no setterinherited
itemBackgroundColor WidgetStateProperty<Color?>?
The itemBackgroundColor property sets the background color for the individual suggestion items based on their state, such as hovered or pressed.
final
itemOverflow → SuggestionOverflow
The itemOverflow property determines whether suggestion items will wrap to fit within available space or scroll beyond it
final
itemPadding EdgeInsetsGeometry
To set the padding between the content of each individual suggestion item.
final
itemShape WidgetStateProperty<ShapeBorder?>?
Used to customize the shape of individual suggestion items based on their state, such as hovered or pressed.
final
orientation Axis
The orientation is used to determine the rendering orientation of the suggestion items and the direction in which the suggestions are scrolled.
final
padding EdgeInsetsGeometry
To sets the padding between the suggestion area and individual suggestion items.
final
runSpacing double
The runSpacing determines a vertical spacing between runs of suggestion items.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectionType → SuggestionSelectionType
The selectionType property specifies how many suggestion items can be selected at once.
final
shape ShapeBorder?
Used to customize the overall shape of the suggestion area.
final
spacing double
The spacing determines a horizontal spacing between individual suggestion items.
final
textStyle WidgetStateProperty<TextStyle?>?
The textStyle used to sets the text style for the suggestion item based on their state, such as hovered or pressed.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited