suggestionSettings property
Settings for customizing the appearance and layout of message suggestions in ChatMessage.
Example:
List<ChatMessage> _messages = <ChatMessage>[
ChatMessage(
suggestionSettings: ChatSuggestionSettings(
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),
);
},
),
textStyle: WidgetStateProperty.resolveWith<TextStyle?>(
(Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return const TextStyle(fontSize: 16);
}
return const TextStyle(fontSize: 14);
},
),
padding: const EdgeInsets.all(10),
itemPadding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8.0),
orientation: Axis.horizontal,
itemOverflow: ChatSuggestionOverflow.scroll,
runSpacing: 10.0,
spacing: 10.0,
),
),
];
Implementation
@override
final ChatSuggestionSettings? suggestionSettings;