# Installation

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](https://getstream.io/chat/docs/sdk/flutter/) for the full decision tree and versioning strategy.

Check the [pub.dev page](https://pub.dev/packages/stream_chat_flutter) 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`:

```yaml
dependencies:
  stream_chat_flutter: ^latest_version
```

`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`:

```yaml
dependencies:
  stream_chat_flutter_core: ^latest_version
```

If you only need the low-level client (pure Dart, no Flutter dependency), use `stream_chat`:

```yaml
dependencies:
  stream_chat: ^latest_version
```

## Optional Packages

For offline persistence, add `stream_chat_persistence`. It works with any of the packages above:

```yaml
dependencies:
  stream_chat_persistence: ^latest_version
```

For built-in translations of the UI SDK strings, add `stream_chat_localizations`:

```yaml
dependencies:
  stream_chat_localizations: ^latest_version
```

After updating `pubspec.yaml`, fetch the packages:

```bash
flutter pub get
```

## Video 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:

```yaml
dependencies:
  media_kit: ^latest_version
  media_kit_video: ^latest_version
  media_kit_libs_video: ^latest_version
```

```dart
StreamChat(
  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:

```dart
videoPlayer: (context, props) {
  if (Platform.isWindows || Platform.isLinux) {
    return MyMediaKitVideoPlayer(props: props);
  }
  return DefaultStreamVideoPlayer(props: props);
},
```

See [Customizing Widgets](https://getstream.io/chat/docs/sdk/flutter/stream-chat-flutter/customizing-widgets/) for how the component factory works.

---

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/flutter/basics/installation/](https://getstream.io/chat/docs/sdk/flutter/basics/installation/).