Flutter Chatbot UI Kit

View Release Notes →

dialogs_chatbot_flutter gives your Flutter app a complete, ready-made chatbot screen for iOS and Android. Drop in EnxChatScreen as a route, or embed EnxChatWidget anywhere in your layout, and you get the message list, input bar, attachments, typing indicator, rich bot content and a built-in agent video call overlay — with only a Bot ID and host URL. The chat engine runs in a hidden WebView and talks to Dart over a JavaScript bridge, so no Swift or Kotlin code is needed.

Flutter Chatbot UI Kit v1.0.0  ·  Released June 25, 2026

First release, published on pub.dev. See Release Notes for what's included.

  View on pub.dev
One package, two pages

The UI Kit and the Flutter Chatbot SDK are the same package, dialogs_chatbot_flutter. This page covers the ready-made widgets, theming and calling. The SDK page covers EnxChatController on its own — its full API, callbacks, streams and message models — for apps that build their own chat UI.

Setup

Requirements

RequirementValue
Flutter3.10.0 or later
Dart3.0.0 or later (below 4.0.0)
iOS12.0 or later
AndroidminSdkVersion 21 (Android 5.0), with Android System WebView 67 or later
PlatformsiOS and Android only — no web or desktop targets
NetworkRequired at startup to load the chat engine

Installation

Add the UI Kit to your app's pubspec.yaml. Two of its dependencies must also be declared directly in your app: flutter_inappwebview (it renders the video call overlay) and permission_handler (it requests camera and microphone access). If either is missing, the app fails at runtime with a MissingPluginException.

dependencies:
  dialogs_chatbot_flutter: ^1.0.0

  # Required in the host app
  flutter_inappwebview: ^6.1.5
  permission_handler: ^12.0.1

Then fetch the packages:

flutter pub get

Everything is exported from a single import:

import 'package:dialogs_chatbot_flutter/dialogs_chatbot_flutter.dart';

Required Permissions

The UI Kit uses the camera and photo library for attachments, and the camera and microphone for video calls. Declare the permissions below even if you start with chat only — a bot can start a call or ask for a photo at any time.

iOS

In ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>Camera access is required to send photos and make video calls.</string>

<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required for audio and video calls.</string>

<key>NSPhotoLibraryUsageDescription</key>
<string>Photo library access is required to send images.</string>

<key>NSPhotoLibraryAddUsageDescription</key>
<string>Photo library access is required to save images.</string>

In ios/Podfile, set the minimum iOS version:

platform :ios, '12.0'

Android

In android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<!-- Android 13+ (API 33+) -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />

<!-- Android 12 and below -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
    android:maxSdkVersion="32" />

In android/app/build.gradle:

android {
    defaultConfig {
        minSdkVersion 21
    }
}

What each permission is for

PermissionUsed for
INTERNETAlways — loading the chat engine and the socket connection
CAMERA / NSCameraUsageDescriptionTaking a photo to send, and video calls
RECORD_AUDIO / NSMicrophoneUsageDescriptionAudio and video calls
READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_EXTERNAL_STORAGE / NSPhotoLibraryUsageDescriptionPicking images and videos from the gallery
NSPhotoLibraryAddUsageDescriptionSaving media to the photo library

You don't need to write permission code. The UI Kit asks for camera and microphone access at runtime (through permission_handler) before a call starts. On Android, the plugin's WebViews then grant the page camera and microphone access automatically.

Usage Patterns

Pattern 1 — Full-Screen Chat

The quickest integration. EnxChatScreen is a complete Scaffold with an app bar showing the bot's name and avatar. Push it as a route, for example from a “Chat with us” button. The screen creates, starts and disposes of its own controller.

import 'package:dialogs_chatbot_flutter/dialogs_chatbot_flutter.dart';

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (_) => EnxChatScreen(
      config: const EnxBotConfig(
        botId: 'YOUR_BOT_ID',
        host: 'https://dialogs.enablex.io',
      ),
    ),
  ),
);

Pattern 2 — Embedded Widget

Use EnxChatWidget when the chat should live inside your own layout — a tab, a bottom sheet, a split view or a card. It has no app bar of its own and fills whatever space you give it.

Scaffold(
  appBar: AppBar(title: const Text('Support')),
  body: EnxChatWidget(
    config: const EnxBotConfig(
      botId: 'YOUR_BOT_ID',
      host: 'https://dialogs.enablex.io',
    ),
    theme: EnxChatTheme.mobileClassic,
    onMessageReceived: (msg) => debugPrint('Bot: ${msg.text}'),
  ),
)

Pattern 3 — Widget with Your Own Controller

Create the EnxChatController yourself when the rest of your app needs the chat state — for example to show an unread badge, react to connection changes, or send a message from outside the chat. Pass it to EnxChatWidget.withController or EnxChatScreen.withController. You own the controller, so you call initialize() and dispose().

class ChatPage extends StatefulWidget {
  const ChatPage({super.key});

  @override
  State<ChatPage> createState() => _ChatPageState();
}

class _ChatPageState extends State<ChatPage> {
  late final EnxChatController _controller;

  @override
  void initState() {
    super.initState();
    _controller = EnxChatController(
      config: const EnxBotConfig(
        botId: 'YOUR_BOT_ID',
        host: 'https://dialogs.enablex.io',
      ),
    );

    // Set callbacks before initialize()
    _controller.onStatusChanged = (status) => setState(() {});
    _controller.onError = (message, type) => debugPrint('[$type] $message');

    _controller.initialize();
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return EnxChatWidget.withController(
      controller: _controller,
    );
  }
}

EnxChatController extends ChangeNotifier, so it works with Provider, Riverpod, BLoC, GetX or plain setState. For its full API, streams and callbacks, see the Flutter Chatbot SDK.

Listening to Chat Events

For simple integrations you don't need a controller to observe the chat — EnxChatScreen and EnxChatWidget take callbacks directly as constructor parameters.

EnxChatScreen(
  config: config,
  onMessageReceived: (EnxMessage msg) {
    // Every incoming message
  },
  onMessageSent: (EnxMessage msg) {
    analytics.track('chat_message_sent', {'type': msg.type.name});
  },
  onBotInfo: (Map<String, dynamic> info) {
    debugPrint('Connected to ${info['name']}');
  },
  onError: (String message, String type) {
    debugPrint('[$type] $message');
  },
)
CallbackFires when
onMessageReceived(EnxMessage)A message arrives from the bot (or a user message is echoed back).
onMessageSent(EnxMessage)The user sends a message, after it is added to the list.
onBotInfo(Map<String, dynamic>)Bot metadata (name, avatar, welcome message, settings) arrives after connecting.
onError(String message, String type)The bridge, socket or a file upload reports an error. See error types.
onAudioCall() / onVideoCall()The user taps a call button. See Call buttons.

Theming

EnxChatTheme sets the colours of the app bar, bubbles, background and avatars. Pass it as theme to either widget. Every field has a default, so set only what you want to change.

const myTheme = EnxChatTheme(
  primaryColor: Color(0xFF1A73E8),     // app bar, send button, accents
  userBubbleColor: Color(0xFFE8F0FE),
  botBubbleColor: Colors.white,
  backgroundColor: Color(0xFFF5F5F5),
  userAvatarColor: Color(0xFF1A73E8),
  botAvatarColor: Color(0xFF34A853),
);

EnxChatScreen(config: config, theme: myTheme);

For a ready-made WhatsApp-style look with a compact layout, use the built-in preset:

EnxChatWidget(config: config, theme: EnxChatTheme.mobileClassic);

See EnxChatTheme for every field and its default. Theming in v1.0.0 is limited to these colour tokens and the compact layout switch — there is no API for changing the structure of the screen.

Audio & Video Calling

The UI Kit can show a live call with an agent inside your app, without you writing any call code. When the bot (or an agent behind it) starts a call, a full-screen overlay opens over the chat and loads the call page; when the call ends, the overlay closes and the user is back in the conversation.

How a call runs

Calls in the Flutter UI Kit are browser calls: the call itself is a web page, and the UI Kit shows it in its own WebView. The call is driven entirely by messages from the bot.

  1. The bot sends a message whose audioVideoAction is "start" and whose iFrameUrl is the address of the call page.
  2. EnxChatController stores the URL in activeVideoCallUrl and notifies its listeners.
  3. EnxChatScreen / EnxChatWidget sees the URL and opens EnxVideoCallOverlay on top of the chat. The overlay is a separate InAppWebView (from flutter_inappwebview) with inline media playback enabled.
  4. The call page uses the device camera and microphone through the WebView.
  5. When the call ends, the bot sends a message with audioVideoAction = "stop". The controller calls closeVideoCallOverlay(), activeVideoCallUrl becomes null, and the overlay is dismissed.

See the call sequence diagram for the same flow step by step.

Only browser calls are supported

Unlike the Android Chatbot UI Kit, the Flutter UI Kit has no native call path — a call always runs from an iFrameUrl in the overlay WebView. The call page must be served over HTTPS.

Click-to-call bots

Some bots are set up as click-to-call bots: their purpose is to connect the user to a call rather than to chat. The bot's botInfo.clickToCall setting decides which interface the UI Kit shows:

botInfo.clickToCallWhat the user sees
"text"The full chat interface.
"audio" or "video"A call-only interface instead of the chat.

The setting is read from the server when the chat connects, so you don't configure it in the app. If your app needs to know which interface is showing (for example to change its own app bar), read controller.showClickToCallVideoOnlyUi, which is true when clickToCall is anything other than "text". To start a click-to-call session from your own code, call controller.requestClickToCallVideo().

Call buttons

The input bar can also show audio and video call buttons. To show them, set both callingEnabled: true on EnxBotConfig and showCallingOptions: true on the widget.

EnxChatScreen(
  config: const EnxBotConfig(
    botId: 'YOUR_BOT_ID',
    host: 'https://dialogs.enablex.io',
    callingEnabled: true,
  ),
  showCallingOptions: true,
  onAudioCall: () {
    // The user tapped the audio call button
  },
  onVideoCall: () {
    // The user tapped the video call button
  },
)

Tapping a call button does not start the in-app call overlay. It only calls onAudioCall or onVideoCall, and your app decides what happens — for example, starting a call with your own calling SDK such as the EnableX Video Flutter SDK. The overlay opens only when the bot sends a call-start message.

Reading call state from your app

If you use your own controller (Pattern 3), these properties tell you what the call interface is doing:

MemberDescription
activeVideoCallUrlThe call page URL while the overlay is open; null otherwise.
showClickToCallVideoOnlyUitrue when the bot is a click-to-call bot and the call-only interface is shown.
requestClickToCallVideo()Starts the click-to-call video mode.
closeVideoCallOverlay()Closes the call overlay from your code.

Because the controller is a ChangeNotifier, any widget listening to it rebuilds when a call starts or ends.

Supported Media Types

Sending (User → Bot)

The attachment button in the input bar lets the user pick a file; the UI Kit detects its MIME type and uploads it through the bridge to the EnableX CDN.

TypeSource in the built-in input bar
ImageCamera or gallery (image_picker)
VideoGallery (image_picker)
Document (PDF and other files)System document picker (file_picker)

To send a file from your own code, call controller.sendFile(bytes: ..., fileName: ..., mimeType: ...) — see Sending messages on the SDK page.

Receiving (Bot → User)

Content (EnxMessageType)Rendered as
textMessage bubble, with action link buttons when the bot attaches them
actionOne or more buttons that open a URL
suggestionTappable chips — single-select chips send on tap; multi-select chips let the user pick several and then confirm
imageImage card with title, subtitle, actions and suggestions; images are cached
videoVideo card with thumbnail and play overlay
fileFile attachment card (documents, PDFs and so on)
systemCentred status message, for example live-agent handover
typingAnimated three-dot bubble (EnxTypingBubble) while the bot composes a reply
calendarRendered as text in v1.0.0 — a date picker is planned
API Reference

EnxChatScreen / EnxChatWidget

EnxChatScreen is a full-screen Scaffold with an app bar; EnxChatWidget is the same chat without the app bar, for embedding. Both have the same parameters and two constructors: one that creates and owns its controller from a config, and .withController, which uses a controller you created.

// The widget creates and manages its own controller
EnxChatWidget({
  Key? key,
  required EnxBotConfig config,
  EnxChatTheme theme = const EnxChatTheme(),
  bool showCallingOptions = false,
  void Function(EnxMessage)? onMessageReceived,
  void Function(EnxMessage)? onMessageSent,
  void Function(String, String)? onError,
  void Function(Map<String, dynamic>)? onBotInfo,
  VoidCallback? onAudioCall,
  VoidCallback? onVideoCall,
})

// You provide the controller
EnxChatWidget.withController({
  Key? key,
  required EnxChatController controller,
  EnxChatTheme theme = const EnxChatTheme(),
  bool showCallingOptions = false,
  void Function(EnxMessage)? onMessageReceived,
  void Function(EnxMessage)? onMessageSent,
  void Function(String, String)? onError,
  void Function(Map<String, dynamic>)? onBotInfo,
  VoidCallback? onAudioCall,
  VoidCallback? onVideoCall,
})

// EnxChatScreen(...) and EnxChatScreen.withController(...) take the same parameters
ParameterTypeDescription
configEnxBotConfigBot configuration. Required for the default constructor.
controllerEnxChatControllerYour controller. Required for .withController; you call initialize() and dispose() on it.
themeEnxChatThemeColours and layout. Defaults to const EnxChatTheme().
showCallingOptionsboolShows the audio and video call buttons in the input bar. Default false.
onMessageReceivedvoid Function(EnxMessage)?A message was received.
onMessageSentvoid Function(EnxMessage)?The user sent a message.
onErrorvoid Function(String, String)?An error occurred: message and type.
onBotInfovoid Function(Map<String, dynamic>)?Bot metadata was received.
onAudioCallVoidCallback?The audio call button was tapped.
onVideoCallVoidCallback?The video call button was tapped.

EnxBotConfig

An immutable, const-constructible object that identifies the bot. It is sent to the chat engine when the chat starts.

const EnxBotConfig({
  required String botId,
  required String host,
  String rootPath = '',
  bool callingEnabled = false,
})
FieldTypeRequiredDescription
botIdStringYesBot identifier from the EnableX Dialogs dashboard.
hostStringYesBase URL of the Dialogs backend, for example https://dialogs.enablex.io.
rootPathStringNoOptional URL path prefix appended to host. Default ''.
callingEnabledboolNoEnables the audio and video call buttons in the input bar. Default false. See Call buttons.

EnxChatTheme

const EnxChatTheme({
  Color primaryColor = const Color(0xFF075E54),
  Color userBubbleColor = const Color(0xFFDCF8C6),
  Color botBubbleColor = Colors.white,
  Color backgroundColor = const Color(0xFFECE5DD),
  Color userAvatarColor = const Color(0xFF2196F3),
  Color botAvatarColor = const Color(0xFF4CAF50),
  bool useMobileClassicLayout = false,
})
FieldDefaultApplies to
primaryColor#075E54 (dark green)App bar, send button, accents
userBubbleColor#DCF8C6 (light green)User message bubbles
botBubbleColor#FFFFFFBot message bubbles
backgroundColor#ECE5DD (off-white)Chat area background
userAvatarColor#2196F3 (blue)User avatar
botAvatarColor#4CAF50 (green)Bot avatar
useMobileClassicLayoutfalseSwitches to a compact layout for small screens

EnxChatTheme.mobileClassic is a static preset: the WhatsApp-style green theme with the compact layout turned on.

For EnxChatController, EnxMessage, the sub-models and the enums, see the Flutter Chatbot SDK API reference.

Architecture

Layered Architecture

Your app talks only to the widgets and, optionally, the controller. Everything below that is inside the plugin: the controller owns a JavaScript bridge, and the bridge drives a hidden WebView that runs the chat engine and holds the socket connection. Calls use a second, separate WebView.

Layered architecture: your Flutter app pushes or embeds EnxChatScreen or EnxChatWidget; the UI layer renders the chat list, message cells, input bar, typing bubble and video call overlay; EnxChatController notifies the UI and owns EnxWebViewBridge, which drives a hidden WebView connected to the EnableX Dialogs server; the overlay loads the agent call page.
Green = this plugin, purple = the hidden chat WebView, blue = your app and remote services.
LayerResponsibility
UI layerEnxChatScreen and EnxChatWidget, built from EnxChatList (scrolling list with date separators), EnxMessageCell (one renderer per message type), EnxInputBar (text, attachments, call buttons), EnxTypingBubble and EnxVideoCallOverlay.
ControllerEnxChatController holds all chat state (messages, status, typing, bot info, call state), exposes streams and callbacks, and provides the send, reset and reconnect methods.
BridgeEnxWebViewBridge loads assets/chat/chat.html into a hidden 1×1 WebView, sends it the bot config, receives its events over a JavaScript channel named EnxChannel and sends it commands.
Hidden chat WebViewRuns the EnableX chat runtime and the Socket.IO connection to the Dialogs server. File uploads go from here to the EnableX CDN over HTTPS.
Call overlayEnxVideoCallOverlay is a separate InAppWebView that loads the call page. It has no access to the chat WebView.

Sequence Diagrams

Click any diagram to open it at full size.

Chat startup & messaging

From creating the controller, through the WebView handshake and connection, to sending a message and receiving the bot's reply.

Sequence diagram: the app creates and initializes EnxChatController, the bridge loads chat.html and posts the config, the WebView connects to the server, connection and bot info events flow back to the app; then a text message is sent, a typing event and the bot reply come back through the bridge.
Solid arrows are calls; dashed arrows are events coming back from the WebView or server. The user's message appears immediately, before the server confirms it.

Video call overlay

From the bot's call-start message to the overlay closing.

Sequence diagram: the server sends a message with audioVideoAction start and an iFrameUrl, the controller sets activeVideoCallUrl, the widget shows EnxVideoCallOverlay which loads the call page; a later stop message makes the controller call closeVideoCallOverlay and the overlay is dismissed.
The call itself runs inside the overlay WebView; the chat WebView only carries the start and stop messages.

The connection state machine (EnxConnectionStatus) is shown on the Flutter Chatbot SDK page.

Feature Support

Feature Support (v1.0.0)

FeatureSupportedNotes
Full-screen and embeddable chatYesEnxChatScreen (with app bar) and EnxChatWidget; bot name and avatar come from the bot's metadata.
Bring-your-own controllerYes.withController on both widgets; works with Provider, Riverpod, BLoC, GetX or setState.
Theme coloursYesEnxChatTheme colour tokens and the mobileClassic preset.
Text, action buttons, suggestion chipsYesSingle- and multi-select chips.
Image, video and file cardsYesImage caching, video thumbnails with play overlay.
Sending attachmentsYesCamera, gallery and document picker; MIME type detected automatically.
Typing indicatorYesAnimated three-dot bubble.
System / handover messagesYesCentred status messages.
In-app video call overlayYesOpens automatically on the bot's call-start message (iFrameUrl); closes on call-stop.
Click-to-call botsYesCall-only interface when botInfo.clickToCall is "audio" or "video".
Call buttons in the input barYesReport taps through onAudioCall / onVideoCall; your app handles the call.
Conversation resetYesEnxChatController.resetConversation().
Native (token-based) callsNoCalls always run from an iFrameUrl in the overlay WebView.
Calendar date pickerNocalendar messages render as text in v1.0.0; a date picker is planned.
Structural UI customisationNoOnly colour tokens and the compact layout switch.
Offline message queueNoMessages sent while disconnected are lost; watch the connection status and prompt the user to retry.
Web and desktopNoiOS and Android only. For web, use the Web Chatbot SDK.
Reference

Known Limitations

  • iOS and Android only — no web or desktop targets.
  • flutter_inappwebview and permission_handler must be declared directly in your app's pubspec.yaml.
  • Calls are browser calls only; there is no native call path.
  • Call buttons report taps to your app but don't open the in-app call overlay.
  • The call overlay opens only when the bot sends a call-start message or a click-to-call configuration.
  • calendar messages render as text in v1.0.0.
  • No offline queue — messages sent while disconnected are not retried.
  • Requires network access at startup, and Android System WebView 67 or later.

Troubleshooting

Chat shows a blank screen or the spinner never stops

  • Check that botId and host are correct.
  • Confirm the device can reach host.
  • Add an onError callback and look for bridge_error or socket_error.

MissingPluginException for flutter_inappwebview

  • Add flutter_inappwebview: ^6.1.5 (and permission_handler) to your app's pubspec.yaml.
  • Run flutter pub get and do a full rebuild — hot reload does not pick up new plugins.

Video call overlay is black

  • Confirm the iFrameUrl is HTTPS.
  • Confirm the user granted camera and microphone access, and that NSCameraUsageDescription and NSMicrophoneUsageDescription are in Info.plist.
  • During development against a non-HTTPS server on iOS, add an NSAppTransportSecurity exception.

Call buttons don't appear, or nothing happens when tapped

  • Set both callingEnabled: true on EnxBotConfig and showCallingOptions: true on the widget.
  • Provide onAudioCall / onVideoCall — the buttons only report taps; see Call buttons.

File upload fails on iOS

  • Add all the photo and camera usage descriptions to Info.plist (see iOS permissions).

Images or videos don't play inline on Android

  • Check that minSdkVersion is at least 21 and that Android System WebView is up to date. The UI Kit configures the WebView for inline playback automatically.

FAQ

Is the UI Kit a different package from the Flutter Chatbot SDK?

No. Both use dialogs_chatbot_flutter. Use the widgets on this page for a ready-made chat; use EnxChatController on its own (see the SDK page) to build your own interface.

Do I need to open the call screen myself?

No. When the bot sends a call-start message, the UI Kit opens the overlay itself and closes it when the call ends. You only need the permissions in place. See How a call runs.

Why doesn't tapping the video call button open a call?

In v1.0.0 the call buttons hand control to your app through onAudioCall and onVideoCall. The in-app overlay is opened only by the bot. See Call buttons.

Can calls run natively instead of in a WebView?

Not in the Flutter UI Kit — calls always load an iFrameUrl in the overlay WebView. If you need a native call, start it from onVideoCall with a calling SDK of your choice.

How much can I change the look?

The colours in EnxChatTheme and the compact layout switch. For a fully custom interface, build your own widgets on top of EnxChatController.