# chatwoot/chatwoot-flutter-sdk architecture

> Architecture diagram of the GitHub repository chatwoot/chatwoot-flutter-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chatwoot/chatwoot-flutter-sdk
- Repository: https://github.com/chatwoot/chatwoot-flutter-sdk

## Overview

This Flutter SDK offers two integration paths: embed Chatwoot’s website widget, or build a custom chat UI with ChatwootClient. In the client path, an app creates a client with callbacks and loads or sends messages; callbacks expose messaging and connection events. The README also identifies Hive-backed local persistence. The tree shows UI, repository, remote-service, and storage modules, but no source excerpts were provided, so their internal call relationships are not verified here.

Main entry points: [`lib/chatwoot_client.dart`](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_client.dart) (Chatwoot Client), [`lib/data/local/local_storage.dart`](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/local_storage.dart) (Hive Storage), [`lib/data/remote/service/chatwoot_client_service.dart`](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/service/chatwoot_client_service.dart) (Remote API Service), [`lib/data/local/entity`](https://github.com/chatwoot/chatwoot-flutter-sdk/tree/develop/lib/data/local/entity) (Stored Entities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public_api["Public API"]
  node_sdk_api["SDK Entry<br/>[chatwoot_sdk.dart]"]
  node_parameters["Client Parameters"]
end

subgraph group_embedded_chat["Embedded Chat"]
  node_widget["Website Widget"]
  node_webview["WebView Host<br/>[webview.dart]"]
  node_widget_utils["Widget Utilities<br/>[utils.dart]"]
  node_chat_page["Chat Page"]
  node_chat_dialog["Chat Dialog"]
  node_chat_theme["Chat Theme"]
end

subgraph group_client_runtime["Client Runtime"]
  node_client["Chatwoot Client"]
  node_callbacks["Event Callbacks"]
  node_repository["Chat Repository"]
  node_remote_api["Remote API Service"]
  node_auth["Client Auth"]
  node_interceptor["API Interceptor"]
  node_requests["API Requests"]
  node_events["Remote Events"]
end

subgraph group_local_data["Local Data"]
  node_storage[("Hive Storage<br/>[local_storage.dart]")]
  node_contact_dao["Contact DAO"]
  node_conversation_dao["Conversation DAO"]
  node_message_dao["Messages DAO"]
  node_user_dao["User DAO"]
  node_entities["Stored Entities"]
end

node_app_user(("Flutter App"))
node_chatwoot_service(("Chatwoot Server"))

node_app_user -->|"embeds"| node_widget
node_app_user -->|"creates"| node_client
node_app_user -->|"loads messages"| node_client
node_app_user -->|"sends messages"| node_client
node_app_user -->|"provides"| node_callbacks
node_widget -->|"connects to"| node_chatwoot_service
node_client -->|"notifies"| node_callbacks
node_client -->|"uses Hive"| node_storage
node_client -.-> node_repository
node_repository -.-> node_remote_api
node_remote_api -.-> node_chatwoot_service
node_auth -.-> node_remote_api
node_interceptor -.-> node_remote_api
node_storage -.-> node_contact_dao
node_storage -.-> node_conversation_dao
node_storage -.-> node_message_dao
node_storage -.-> node_user_dao
node_contact_dao -.-> node_entities
node_conversation_dao -.-> node_entities
node_message_dao -.-> node_entities
node_user_dao -.-> node_entities

click node_sdk_api "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_sdk.dart"
click node_parameters "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_parameters.dart"
click node_widget "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/webview_widget/chatwoot_widget.dart"
click node_webview "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/webview_widget/webview.dart"
click node_widget_utils "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/webview_widget/utils.dart"
click node_chat_page "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/chatwoot_chat_page.dart"
click node_chat_dialog "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/chatwoot_chat_dialog.dart"
click node_chat_theme "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/chatwoot_chat_theme.dart"
click node_client "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_client.dart"
click node_callbacks "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_callbacks.dart"
click node_repository "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/chatwoot_repository.dart"
click node_remote_api "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/service/chatwoot_client_service.dart"
click node_auth "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/service/chatwoot_client_auth_service.dart"
click node_interceptor "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/service/chatwoot_client_api_interceptor.dart"
click node_requests "https://github.com/chatwoot/chatwoot-flutter-sdk/tree/develop/lib/data/remote/requests"
click node_events "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/responses/chatwoot_event.dart"
click node_storage "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/local_storage.dart"
click node_contact_dao "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/dao/chatwoot_contact_dao.dart"
click node_conversation_dao "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/dao/chatwoot_conversation_dao.dart"
click node_message_dao "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/dao/chatwoot_messages_dao.dart"
click node_user_dao "https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/dao/chatwoot_user_dao.dart"
click node_entities "https://github.com/chatwoot/chatwoot-flutter-sdk/tree/develop/lib/data/local/entity"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sdk_api,node_parameters toneBlue
class node_widget,node_webview,node_widget_utils,node_chat_page,node_chat_dialog,node_chat_theme toneAmber
class node_client,node_callbacks,node_repository,node_remote_api,node_auth,node_interceptor,node_requests,node_events,node_chatwoot_service toneMint
class node_storage,node_contact_dao,node_conversation_dao,node_message_dao,node_user_dao,node_entities toneRose
class node_app_user toneIndigo
```

## Components

### Public API

- [SDK Entry](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_sdk.dart): `lib/chatwoot_sdk.dart`
- [Client Parameters](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_parameters.dart): `lib/chatwoot_parameters.dart`

### Embedded Chat

- [Website Widget](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/webview_widget/chatwoot_widget.dart): `lib/ui/webview_widget/chatwoot_widget.dart`
- [WebView Host](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/webview_widget/webview.dart): `lib/ui/webview_widget/webview.dart`
- [Widget Utilities](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/webview_widget/utils.dart): `lib/ui/webview_widget/utils.dart`
- [Chat Page](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/chatwoot_chat_page.dart): `lib/ui/chatwoot_chat_page.dart`
- [Chat Dialog](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/chatwoot_chat_dialog.dart): `lib/ui/chatwoot_chat_dialog.dart`
- [Chat Theme](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/ui/chatwoot_chat_theme.dart): `lib/ui/chatwoot_chat_theme.dart`

### Client Runtime

- [Chatwoot Client](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_client.dart): `lib/chatwoot_client.dart`
- [Event Callbacks](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/chatwoot_callbacks.dart): `lib/chatwoot_callbacks.dart`
- [Chat Repository](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/chatwoot_repository.dart): `lib/data/chatwoot_repository.dart`
- [Remote API Service](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/service/chatwoot_client_service.dart): `lib/data/remote/service/chatwoot_client_service.dart`
- [Client Auth](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/service/chatwoot_client_auth_service.dart): `lib/data/remote/service/chatwoot_client_auth_service.dart`
- [API Interceptor](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/service/chatwoot_client_api_interceptor.dart): `lib/data/remote/service/chatwoot_client_api_interceptor.dart`
- [API Requests](https://github.com/chatwoot/chatwoot-flutter-sdk/tree/develop/lib/data/remote/requests): `lib/data/remote/requests`
- [Remote Events](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/remote/responses/chatwoot_event.dart): `lib/data/remote/responses/chatwoot_event.dart`

### Local Data

- [Hive Storage](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/local_storage.dart): `lib/data/local/local_storage.dart`
- [Contact DAO](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/dao/chatwoot_contact_dao.dart): `lib/data/local/dao/chatwoot_contact_dao.dart`
- [Conversation DAO](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/dao/chatwoot_conversation_dao.dart): `lib/data/local/dao/chatwoot_conversation_dao.dart`
- [Messages DAO](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/dao/chatwoot_messages_dao.dart): `lib/data/local/dao/chatwoot_messages_dao.dart`
- [User DAO](https://github.com/chatwoot/chatwoot-flutter-sdk/blob/develop/lib/data/local/dao/chatwoot_user_dao.dart): `lib/data/local/dao/chatwoot_user_dao.dart`
- [Stored Entities](https://github.com/chatwoot/chatwoot-flutter-sdk/tree/develop/lib/data/local/entity): `lib/data/local/entity`

### Other components

- **Flutter App**
- **Chatwoot Server**

## Connections

- Flutter App → Website Widget: embeds (evidence: `README.md`)
- Flutter App → Chatwoot Client: creates (evidence: `README.md`)
- Flutter App → Chatwoot Client: loads messages (evidence: `README.md`)
- Flutter App → Chatwoot Client: sends messages (evidence: `README.md`)
- Flutter App → Event Callbacks: provides (evidence: `README.md`)
- Website Widget → Chatwoot Server: connects to (evidence: `README.md`)
- Chatwoot Client → Event Callbacks: notifies (evidence: `README.md`)
- Chatwoot Client → Hive Storage: uses Hive (evidence: `README.md`)
- Chatwoot Client → Chat Repository
- Chat Repository → Remote API Service
- Remote API Service → Chatwoot Server
- Client Auth → Remote API Service
- API Interceptor → Remote API Service
- Hive Storage → Contact DAO
- Hive Storage → Conversation DAO
- Hive Storage → Messages DAO
- Hive Storage → User DAO
- Contact DAO → Stored Entities
- Conversation DAO → Stored Entities
- Messages DAO → Stored Entities
- User DAO → Stored Entities
