itemBackgroundColor property

WidgetStateProperty<Color?>? itemBackgroundColor
final

To set the background color of individual footer items based on their state, such as hovered or pressed.

Example:

@override
Widget build(BuildContext context) {
  return SfAIAssistView(
    responseToolbarSettings: AssistMessageToolbarSettings(
      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;
        },
      ),
    ),
  );
}

Implementation

final WidgetStateProperty<Color?>? itemBackgroundColor;