itemBackgroundColor property

  1. @override
WidgetStateProperty<Color?>? itemBackgroundColor
final

The itemBackgroundColor property sets the background color for the individual suggestion items based on their state, such as hovered or pressed.

Example:

List<AssistMessage> _messages = <AssistMessage>[
  AssistMessage.response(
    suggestionSettings: AssistSuggestionSettings(
      itemBackgroundColor: WidgetStateProperty.resolveWith<Color>(
        (states) {
          if (states.contains(WidgetState.hovered)) {
            return Colors.grey[400]!;
          }
          return Colors.grey;
        },
      ),
    )
  ),
];

Implementation

@override
final WidgetStateProperty<Color?>? itemBackgroundColor;