Package installation
This package depends on supabase_flutter: follow its instructions to add Supabase to your app.
Requirements: Dart >=3.9.0 and Flutter >=3.35.0.
dependencies:
flutter_supabase_chat_core: ^2.0.0
supabase_flutter: ^2.17.2
uuid: ^4.5.1
# Optional, for the ready-made UI:
flutter_chat_ui: ^2.11.1
flyer_chat_text_message: ^2.6.0
flyer_chat_image_message: ^2.3.0
flyer_chat_file_message: ^2.4.0
Check the current version on pub.dev.
Since 2.x the package builds on flutter_chat_core (not flutter_chat_types): messages are flutter_chat_core Messages, and rooms and users are the package's own ChatRoom and ChatUser.
flutter_chat_ui 2.x ships no renderer for images, files or audio (only a minimal text fallback): add one flyer_chat_*_message package per message type you render, or write your own builder (the example app has its own voice message bubble).
Since 2.12.0 flutter_chat_ui (and the flyer_chat_*_message packages) build on material_ui, the Material library decoupled from Flutter (3.47 or newer). Its Material and Theme are distinct from the deprecated package:flutter/material.dart ones: an app built with flutter/material.dart crashes in the composer ("No Material widget found"). Import package:material_ui/material_ui.dart in your app instead, as the example app does; ChatTheme.fromThemeData (since flutter_chat_core 2.9.1) takes that ThemeData too.
Initialize Supabase before using the package: SupabaseChatCore.instance is bound to Supabase.instance.client.
await Supabase.initialize(
url: 'https://<project-ref>.supabase.co',
publishableKey: '<anon-or-publishable-key>',
);
Upgrading an existing 1.x project? See MIGRATION.md, including the required database migration.