setChatBackgroundImage method

void setChatBackgroundImage(
  1. ImageProvider<Object> image, {
  2. BoxFit fit = BoxFit.cover,
  3. Alignment alignment = Alignment.center,
  4. ColorFilter? colorFilter,
  5. double opacity = 1.0,
  6. bool showEmptyText = true,
})

Convenience helper to set a chat background image with optional fitting, opacity, and text suppression.

Implementation

void setChatBackgroundImage(
  ImageProvider image, {
  BoxFit fit = BoxFit.cover,
  Alignment alignment = Alignment.center,
  ColorFilter? colorFilter,
  double opacity = 1.0,
  bool showEmptyText = true,
}) {
  chatBackgroundDecoration = BoxDecoration(
    image: DecorationImage(
      image: image,
      fit: fit,
      alignment: alignment,
      colorFilter: colorFilter,
      opacity: opacity,
    ),
  );
  showEmptyChatState = showEmptyText;
  notifyListeners();
}