搜尋套件、儲存庫與 APP 分類

dash_chat_2 封面
套件詳情v0.0.21

dash_chat_2

Flutter 最完整的聊天介面。容易使用、高度可自訂且功能齊全

AndroidiOSWebmacOS
近 30 天下載
4060
喜歡數
312
Pub 分數
110

安裝套件

flutter pub add dash_chat_2

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Dash Chat 2 是一個功能完整、高度可自訂的 Flutter 聊天 UI 組件,設計上易於實作,同時提供全方位的功能。支援即時訊息傳遞,包含豐富的消息類型、輸入狀態指示器、訊息反應與媒體附件。專為跨平台使用而打造,可在 Android、iOS、Web 和 macOS 上順暢運行。該套件開箱即用提供乾淨現代的介面,並提供廣泛的樣式與行為自訂選項。非常適合開發者快速且高效地建構具備聊天功能的應用程式。

適用情境

  • 即時訊息應用
  • 客戶支援聊天介面
  • 群組聊天應用
  • 應用內通訊功能
  • 社交網絡平台

主要特色

  • 豐富訊息類型(文字、圖片、檔案)
  • 輸入指示器
  • 訊息回應
  • 可自定義的UI主題
  • 跨平台相容性
  • 與後端服務的輕鬆整合

適合對象

  • 開發聊天功能的開發者
  • 需要快速聊天實現的初創企業
  • 需要響應式聊天UI的應用程式
  • 希望高度客製化的團隊
  • 針對多個平台的專案

使用建議

  • 需要後端支援持久化訊息
  • 即時同步需要自定義邏輯
  • 樣式可能需要進階的Flutter知識
  • 有限的內建訊息歷史記錄管理
  • 不適用於需要擴展的複雜聊天工作流程

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

The most complete Chat UI for flutter

Easy to use, highly customizable and fully featured

License Pub version Contributors

Features

  • Fully customizable components
  • Multi-line TextInput
  • Touchable links using flutter_parsed_text
  • Markdown support using flutter_markdown
  • Avatar as user's initials or profile picture
  • Quick Reply messages
  • Load earlier messages
  • Scroll to bottom Widget
  • Multiple media support (Audio support: WIP)
  • @ Mention users (or anything else)
  • Typing users
  • Reply to messages - WIP
  • Message status - WIP

You need another feature? you can use the customProperties field of the models, it allows you to pass other data to the library that you can then use inside custom builders to implement any feature you need.

Of course, if you think this feature can be useful to other people, feel free to open an issue/pull-request to discuss including it "natively" in the package.

Basic Usage

import 'package:dash_chat_2/dash_chat_2.dart';
import 'package:flutter/material.dart';

class Basic extends StatefulWidget {
  @override
  _BasicState createState() => _BasicState();
}

class _BasicState extends State<Basic> {
  ChatUser user = ChatUser(
    id: '1',
    firstName: 'Charles',
    lastName: 'Leclerc',
  );

  List<ChatMessage> messages = <ChatMessage>[
    ChatMessage(
      text: 'Hey!',
      user: user,
      createdAt: DateTime.now(),
    ),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Basic example'),
      ),
      body: DashChat(
        currentUser: user,
        onSend: (ChatMessage m) {
          setState(() {
            messages.insert(0, m);
          });
        },
        messages: messages,
      ),
    );
  }
}

You can run the example project to see more complex ways of using the package

Parameters of DashChat

  • ChatUser currentUser - required: Basically "you", we need to know who is the current user to put their messages to right side

  • Function(ChatMessage message) onSend - required: Function to call when the user sends a message, that's where you handle the logic to send the message to your backend and append the list of messages

  • List<ChatMessage> messages - required: The list of messages of the channel, you would usually not load all the messages at once but use the onLoadEarlier param of MessageListOptions to trigger a lazy loading

  • InputOptions inputOptions - optional: Options to customize the behaviour and design of the chat input

  • MessageOptions messageOptions - optional: Options to customize the behaviour and design of the messages

  • MessageListOptions messageListOptions - optional: Options to customize the behaviour and design of the overall list of message

  • QuickReplyOptions quickReplyOptions - optional: Options to customize the behaviour and design of the quick replies

  • ScrollToBottomOptions scrollToBottomOptions - optional: Options to customize the behaviour and design of the scroll-to-bottom button

  • readOnly - optional (default to false): Option to make the chat read only, it will hide the input field

  • List<ChatUser> typingUsers - optional: List of users currently typing in the chat

Full documentation

You can browse the full Dart documentation here: Documentation

Found this project useful?

If you found this project useful, then please consider giving it a ⭐️ on Github: https://github.com/SebastienBtr/Dash-Chat-2

Issues and feedback

If you have any suggestions for including a feature or if something doesn't work, feel free to open a Github issue or to open a pull request, you are more than welcome to contribute!

Contributors

SebastienBtr
SebastienBtr

💻 🎨
chuusungmin
chuusungmin

💻
fufesou
fufesou

💻
Nwachi ifeanyichukwu Victor
Nwachi ifeanyichukwu Victor

💻
Kaede Games
Kaede Games

💻
Derek Pitts
Derek Pitts

💻
Alex Fernandez
Alex Fernandez

💻
lawrence
lawrence

💻
Md. Al-Amin
Md. Al-Amin

💻
TPF
TPF

💻

Credits

Thanks to Fayeed who created the v1 of this package: https://github.com/fayeed/dash_chat and made that possible!

所屬分類

依賴

依賴清單 6 項

原始碼儲存庫

使用此套件的專案