패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.0.0

flutter_supabase_chat_core

활동적으로 유지 관리되고 커뮤니티 중심의 Supabase BaaS로 채팅 애플리케이션에 사용되며, 선택적인 채팅 UI를 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.5천
좋아요
53
Pub 점수
160

패키지 설치

flutter pub add flutter_supabase_chat_core

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

커뮤니티 중심으로 지속적으로 유지 관리되는 Flutter 패키지로, 채팅 애플리케이션의 백엔드로 Supabase를 통합합니다. 실시간 메시징, 사용자 인증 및 데이터 관리를 위한 핵심 기능을 제공하며, 개발 속도를 높이기 위해 선택적으로 사전 구축된 채팅 UI도 제공합니다. Android, iOS, Web, macOS, Windows, Linux에서 원활하게 사용할 수 있도록 설계되어, 오픈소스 Firebase 대안인 Supabase를 활용해 확장 가능한 채팅 기능을 쉽게 구현할 수 있습니다. 유연한 커스터마이제이션과 빠른 구현을 원하는 팀에게 이상적입니다.

사용 사례

  • 실시간 그룹 메시징
  • 사용자 간 개인 채팅
  • 채팅 기반 협업 앱
  • 다중 플랫폼 채팅 인터페이스
  • Supabase 인증과의 통합
  • 채팅 기능의 빠른 프로토타이핑

주요 기능

  • 실시간 메시지 동기화
  • 내장된 Supabase 통합
  • 선택적 사용 가능한 채팅 UI
  • 크로스 플랫폼 지원
  • 확장 가능한 아키텍처
  • 활성화된 커뮤니티 유지보수

적합한 대상

  • Supabase를 사용하는 개발자
  • 채팅 앱을 개발하는 팀
  • 프론트엔드 중심의 플러터 개발자
  • 빠른 채팅 구현이 필요한 프로젝트
  • 오픈소스 애호가
  • 다중 장치 동기화가 필요한 앱

고려 사항

  • Supabase 프로젝트 설정이 필요합니다
  • UI 사용자 지정은 코드 변경이 필요할 수 있습니다
  • Supabase 서비스 가용성에 따라 다름
  • Supabase 생태계에 한정
  • 추가 상태 관리가 필요할 수 있습니다
  • Supabase 외 백엔드에는 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.


Pub Pub Pub Build Status CodeFactor

Pub Build Status CodeFactor

Flyer Chat logo

Flutter Supabase Chat Core

Add chat support to your app in 10 minutes!


This project is an implementation of the flutter_chat_types, flutter_chat_ui packages based on a backend created with Supabase.


Actively maintained, community-driven Supabase BaaS for chat applications with an optional chat UI.


⚠️⚠️ This project has been optimized to support scalability, but careful evaluation is recommended before integrating it into large-scale projects, considering specific requirements and available resources. ⚠️⚠️


Chat Image


Have you ever wanted to implement a chat in your application? Do you think it's difficult and complex?

Try this, thanks to the magnificent Supabase platform and the Flutter Chat UI package, you can achieve it in just a few minutes and effortlessly.


Flyer Chat is a platform for creating in-app chat experiences using Flutter. This repository contains Supabase BaaS implementation for Flutter. We are also working on our more advanced SaaS and self-hosted solutions.

  • Free, open-source and community-driven. We offer no paid plugins and strive to create an easy-to-use, almost drop-in chat experience for any application. Contributions are more than welcome! Please read our Contributing Guide.

  • Chat UI agnostic. You can choose the chat UI you prefer. But if you don't have one, we provide our own free and open-source Flutter Chat UI, which can be used to create a working chat in minutes.

  • Easy to use. Returns streams of data for messages, rooms and users. Supabase Security Rules control access to the data. Check our documentation for the info.

Getting Started

The example project that you find in the package repository allows you to have a cross-platform chat app in just a few minutes.

Requirements

Dart >=2.19.0 and Flutter >=3.0.0, Supabase project.

Create a Supabase project
  1. Install Supabase CLI: Official documentation
  2. Open your bash
  3. Login with Supabase:
supabase login
  1. Create new project (For example demo-chat):
supabase projects create demo-chat
  1. Select your organization
  2. Select an region
  3. Insert a secure password for new Postgres database (Save this in a secure location)
  4. Obtain your REFERENCE ID (After command select your project, for example demo-chat):
supabase projects list
  1. Obtain your anon key (After command select your project, for example demo-chat):
supabase projects api-keys
  1. Edit example project file example/lib/supabase_options.dart, insert your project {{your_project_reference_id}} and {{supabase_anon_key}}
Prepare Supabase project

Inside the example project (example/utils) there is a script, running the latter will automatically configure the Supabase project, creating tables, security rules, buckets and everything that is necessary for the example project to function.

In order to run the script you need to be aware of the following information about your Supabase project:

  • host : Project host
  • port : Database port
  • database : Database name
  • user : Database user
  • password : Database password

This information, except the password which is provided only during the creation of the database (if necessary, you can use the password reset function of your database to obtain it), can be found very easily from the Dashboard of your Supabase project:

Supabase dashboard database info

Running prepare script

Below are the commands for running the scripts (During execution you will be asked for the password for your database user):

Required psql installed -> Official documentation

Linux
cd ./example/utils/
./prepare.sh -h "your-postgres-host" -p your-postgres-port -d "your-postgres-database-name" -U "your-postgres-user"
Windows
cd .\example\utils\
.\prepare.ps1 -hostname "your-postgres-host" -port your-postgres-port -database "your-postgres-database-name" -user "your-postgres-user"

after running the database preparation script. you need to change the database schema exposure setting by adding the chats schema (from the supabase dashboard):

Supabase dashboard schema exposure setting

Optional (Only for test): Disable email verification and save the configuration (To speed up testing and allow user registration in just one click, it is advisable to disable mailbox verification):

Supabase dashboard disable email verification

Read our documentation or see the example project. To run the example project you need to have your own Supabase project and then follow Add Supabase to your Flutter app, override example/lib/supabase_options.dart, don't commit it though 😉

After all of this is done you will need to register a couple of users and the example app will automatically suggest email and password on the register screen, default password is Qawsed1-. To set up Supabase Security Rules so users can see only the data they should see, continue with our documentation.

Package Widgets

This package implements some purely logical widgets (Without implementation of a specific UI). These wedgets make it easy to implement some chat-related logic without any effort.

UserOnlineStateObserver

This widget should be placed in the widget tree as soon as possible, this is because this component is responsible for checking and updating the status of the user who logged into the app. When the app is in the foreground other users are notified of the online status, vice versa when the app is closed.

@override
Widget build(BuildContext context) =>
    MaterialApp(
      ...
      home: const UserOnlineStateObserver(
        child: RoomsPage(),
      ),
    );
UserOnlineStatusWidget

This server widget to get the status of a specific user. It can be used, for example, to animate a user's avatar with an LED to indicate their online/offline status.

@override
Widget build(BuildContext context) {
  return UserOnlineStatusWidget(
      uid: user.id,
      builder: (status) {
        //Use status == UserOnlineStatus.online to animate your avatar
      },
  );
}

RLS (Row level security)

The preparation script automatically configures the security rules on the database tables and storage buckets, below is a summary of the rules that are applied:

Tables
Table chats.users
  • INSERT : Nobody, this table is populate by trigger on auth.users.
  • SELECT : All users authenticated.
  • UPDATE : Only the user himself.
  • DELETE : Nobody.
Table chats.rooms
  • INSERT : All users authenticated.
  • SELECT : All users who are members of the chat room.
  • UPDATE : All users who are members of the chat room.
  • DELETE : All users who are members of the chat room.
Table chats.messages
  • INSERT : All users who are members of the chat room.
  • SELECT : All users who are members of the chat room.
  • UPDATE : All users who are members of the chat room.
  • DELETE : All users who are members of the chat room.
Storage buckets
Bucket chats_assets
  • INSERT : All users who are members of the chat room.
  • SELECT : All users who are members of the chat room.
  • UPDATE : All users who are members of the chat room.
  • DELETE : All users who are members of the chat room.
Bucket chats_user_avatar
  • INSERT : Only the user himself.
  • SELECT : All users authenticated.
  • UPDATE : Only the user himself.
  • DELETE : Only the user himself.

Contributing

Please read our Contributing Guide before submitting a pull request to the project.

Code of Conduct

Flyer Chat has adopted the Contributor Covenant as its Code of Conduct, and we expect project participants to adhere to it. Please read the full text so that you can understand what actions will and will not be tolerated.

License

Licensed under the Apache License, Version 2.0

Example project progress

Below are the features implemented for each platform:

Feature Web Android iOS Windows macOS Linux
Signup ✅ ✅ 🟡 ✅ 🟡 🟡
SignIn ✅ ✅ 🟡 ✅ 🟡 🟡
Rooms list screen ✅ ✅ 🟡 ✅ 🟡 🟡
Create direct room ✅ ✅ 🟡 ✅ 🟡 🟡
Create group room 🚧 🚧 🚧 🚧 🚧 🚧
Create channel room 🚧 🚧 🚧 🚧 🚧 🚧
Chat screen ✅ ✅ 🟡 ✅ 🟡 🟡
Search room ✅ ✅ 🟡 ✅ 🟡 🟡
Search message 🚧 🚧 🚧 🚧 🚧 🚧
Search user ✅ ✅ 🟡 ✅ 🟡 🟡
Upload image ✅ ✅ 🟡 ✅ 🟡 🟡
Preview image message ✅ ✅ 🟡 ✅ 🟡 🟡
Upload file ✅ ✅ 🟡 ✅ 🟡 🟡
Download file ✅ ✅ 🟡 ✅ 🟡 🟡
Users online status ✅ ✅ 🟡 ✅ 🟡 🟡
Chat messages pagination ✅ ✅ 🟡 ✅ 🟡 🟡
Users pagination ✅ ✅ 🟡 ✅ 🟡 🟡
Users typing status ✅ ✅ 🟡 ✅ 🟡 🟡
  • ✅ Tested
  • 🟡 Supported but not tested
  • 🚧 Planned

Activities to complete (Roadmap)

Below are some activities to complete to have a more complete and optimized project also for use cases in larger projects.

  1. Add the missing triggers
  2. Error handling
  3. Chat room groups
  4. Chat room channels
  5. Sending audio messages
  6. Improve documentation

카테고리

의존성

의존성 목록 6 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.