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.

Defaults to null.

Example:

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

Implementation

@override
final WidgetStateProperty<Color?>? itemBackgroundColor;