textStyle property

  1. @override
WidgetStateProperty<TextStyle?>? textStyle
final

The textStyle used to sets the text style for the suggestion item based on their state, such as hovered or pressed.

Defaults to null.

Example:

List<ChatMessage> _messages = <ChatMessage>[
 ChatMessage(
  suggestionSettings: ChatSuggestionSettings(
     textStyle: WidgetStateProperty.resolveWith<TextStyle?>(
       (Set<WidgetState> states) {
          if (states.contains(WidgetState.disabled)) {
            return const TextStyle(fontSize: 16);
          }
          return const TextStyle(fontSize: 14);
       },
    ),
  ),
 ),
];

Implementation

@override
final WidgetStateProperty<TextStyle?>? textStyle;