onChatClosed method

void onChatClosed()

Internal method to handle chat closing logic.

Implementation

void onChatClosed() {
  isChatOpen = false;
  closeTimer?.cancel();

  // Delay the close notification to avoid flicker during brief interactions
  closeTimer = Timer(const Duration(seconds: 3), () {
    notifyParent(isOpen: false);
  });
}