Official Flutter UI SDK for Stream Chat

Stream Chat Flutter SDK hero illustration showing chat bubbles and mobile device

The official Flutter UI components for Stream Chat, a service for building chat applications.

Pub CI

Quick Links

Changelog

Check out the changelog on pub.dev to see the latest changes in the package.

Overview

stream_chat_flutter is the full UI SDK — a set of reusable and customizable Flutter widgets built on top of stream_chat_flutter_core and the low-level client stream_chat. It targets Android, iOS, Web, macOS, Windows, and Linux from a single Dart codebase.

This is the recommended starting point for most apps.

Features

  • Rich media messages with Markdown rendering
  • Reactions
  • Threads and quoted replies
  • Typing and read indicators
  • Channel and message lists
  • Message composer with autocomplete triggers (@ mentions, / commands)
  • Image, video, and file uploads with previews and a built-in media gallery viewer
  • Voice messages
  • Polls
  • Drafts
  • Pinned messages
  • Message reminders
  • Message actions context menu (reply, edit, copy, pin, delete, flag, mute, block, and more)
  • Message search
  • Giphy support
  • AI assistant streaming responses
  • Push notifications (Firebase, APN, and Huawei)
  • Offline storage and optimistic updates
  • Static and live location sharing
  • Localization

Flutter Chat Tutorial

The best place to start is the Flutter Chat Tutorial. It teaches you how to use this SDK and also shows how to make frequently required changes.

Example App

This repository includes a fully functional example app with setup instructions. The example is available under the example folder.

Add Dependency

Add this to your pubspec.yaml, using the latest version Pub:

dependencies:
  stream_chat_flutter: ^10.0.0

Then run:

flutter pub get

Android

The package uses photo_manager to access the device's photo library. Follow this wiki to fulfill the Android requirements. You need to take additional steps if you are targeting Android 13. Read this section for more information.

iOS

The library uses the file picker plugin to pick files from the OS. Follow this wiki to fulfill iOS requirements.

We also use video_player to play videos. Follow this guide to fulfill the requirements.

To pick images from the camera, we use the image_picker plugin. Follow these instructions to check the requirements.

Web

Edit your index.html and add the following to the <body> tag to allow the SDK to override the right-click behaviour:

<body oncontextmenu="return false;">

macOS

You need to add the following entitlement:

<key>com.apple.security.network.client</key>
<true/>

For file picking on macOS, see the file_selector package.

Troubleshooting

If you encounter build issues related to the file picker, check the troubleshooting page.

UI Components

These are the key widgets available to build your application UI. Every widget uses the StreamChat or StreamChannel widgets to manage state and communicate with Stream services.

Theming

The Flutter SDK ships with a fully designed set of widgets that you can customize to match your application style.

Starting with V10, theming uses StreamTheme — a Flutter ThemeExtension registered on MaterialApp:

MaterialApp(
  theme: ThemeData(
    brightness: Brightness.light,
    extensions: [StreamTheme.light()],
  ),
  darkTheme: ThemeData(
    brightness: Brightness.dark,
    extensions: [StreamTheme.dark()],
  ),
  home: StreamChat(
    client: client,
    child: const MyHomePage(),
  ),
)

If no StreamTheme is provided, a default theme is automatically created based on Theme.of(context).brightness.

Customizing Colors

Set brand and chrome color swatches on StreamColorScheme to customize the palette — the SDK automatically derives accent and background colors:

MaterialApp(
  theme: ThemeData(
    extensions: [
      StreamTheme(
        brightness: Brightness.light,
        colorScheme: StreamColorScheme.light(
          brand: StreamColorSwatch.fromColor(Colors.indigo),
          chrome: StreamColorSwatch.fromColor(Colors.blueGrey),
        ),
      ),
    ],
  ),
  home: MyHomePage(),
)

See the Theming page for full details.

Customizing Widgets

Widget-level customization is done through StreamComponentFactory — a single entry point for overriding individual builders across the UI SDK.

Offline Storage

To add data persistence, use the official stream_chat_persistence package:

import 'package:stream_chat_persistence/stream_chat_persistence.dart';

final chatPersistentClient = StreamChatPersistenceClient(
  logLevel: Level.INFO,
  connectionMode: ConnectionMode.regular,
);

final client = StreamChatClient(
  apiKey,
  logLevel: Level.INFO,
)..chatPersistenceClient = chatPersistentClient;

Contributing

We welcome code changes that improve this library or fix a problem. Please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on GitHub. Make sure to sign our Contributor License Agreement (CLA) first. See our license file for more details.