dependencies:
stream_chat_flutter: ^latest_versionInstallation
This page covers how to add the Stream Chat Flutter packages to your project. If you are not sure which package to start with, pick stream_chat_flutter — it ships the full UI on top of the state and low-level packages and covers the vast majority of integrations. See the Introduction for the full decision tree and versioning strategy.
Check the pub.dev page for the latest version number, and pin to a caret constraint with all three version numbers (e.g. ^10.0.0) to avoid pulling in unexpected breaking changes.
Adding the UI SDK
For most apps, add stream_chat_flutter to your pubspec.yaml:
stream_core_flutter is an internal package and is pulled in automatically — you do not need to add it manually unless you use its APIs directly.
Adding a Lower-Level Package
If you only need controllers and builders (no UI), use stream_chat_flutter_core:
dependencies:
stream_chat_flutter_core: ^latest_versionIf you only need the low-level client (pure Dart, no Flutter dependency), use stream_chat:
dependencies:
stream_chat: ^latest_versionOptional Packages
For offline persistence, add stream_chat_persistence. It works with any of the packages above:
dependencies:
stream_chat_persistence: ^latest_versionFor built-in translations of the UI SDK strings, add stream_chat_localizations:
dependencies:
stream_chat_localizations: ^latest_versionAfter updating pubspec.yaml, fetch the packages:
flutter pub getVideo Playback on Windows and Linux
The bundled video player supports Android, iOS, macOS, and web. Windows and Linux are not covered out of the box: the SDK previously depended on media_kit to serve them, and that dependency was removed so the vast majority of integrations don't pay for it.
If you target Windows or Linux and want video attachments to play, add media_kit yourself and supply a player through the component factory:
dependencies:
media_kit: ^latest_version
media_kit_video: ^latest_version
media_kit_libs_video: ^latest_versionStreamChat(
client: client,
componentBuilders: StreamComponentBuilders(
extensions: streamChatComponentBuilders(
videoPlayer: (context, props) => MyMediaKitVideoPlayer(props: props),
),
),
child: MyApp(),
)props is a StreamVideoPlayerProps, carrying the attachment to play, the pageIndex of the page inside the enclosing media gallery, and whether to autoplay. Use pageIndex to pause playback when the gallery swipes away from your page.
On the supported platforms the default implementation is DefaultStreamVideoPlayer, so you can fall back to it per platform:
videoPlayer: (context, props) {
if (Platform.isWindows || Platform.isLinux) {
return MyMediaKitVideoPlayer(props: props);
}
return DefaultStreamVideoPlayer(props: props);
},See Customizing Widgets for how the component factory works.