responseToolbarSettings property
Options for changing the appearance of the response message toolbar.
@override
Widget build(BuildContext context) {
return SfAIAssistView(
responseToolbarSettings: AssistMessageToolbarSettings(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0),
),
backgroundColor: Colors.red,
itemShape: WidgetStateProperty.resolveWith(
(Set<WidgetState> state) {
return const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8.0)));
},
),
itemBackgroundColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> state) {
if (state.contains(WidgetState.selected)) {
return Colors.blue;
} else if (state.contains(WidgetState.focused)) {
return Colors.blueGrey;
} else if (state.contains(WidgetState.hovered)) {
return Colors.lightBlueAccent;
} else if (state.contains(WidgetState.disabled)) {
return Colors.grey;
}
return Colors.lightBlue;
},
),
padding: const EdgeInsets.all(10),
itemPadding: const EdgeInsets.all(10),
spacing: 10,
runSpacing: 10,
),
);
}
Implementation
final AssistMessageToolbarSettings responseToolbarSettings;