Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 1.24 KB

README.md

File metadata and controls

60 lines (45 loc) · 1.24 KB

flutter_sendbird

A new flutter plugin project.

Getting Started

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

flutter_sendbird

Sendbird wrapped in flutter

Getting Started

  flutter_sendbird
    git:
      url: https://github.com/sensestar/flutter_sendbird

import

import 'package:flutter_sendbird/flutter_sendbird.dart'

init/ connect

    FlutterSendbird().init('myappId');
    FlutterSendbird().connect(userId, sendbirdToken );
    // start listen events
    FlutterSendbird().listenChannelMessages();

listen message event

    FlutterSendbird().eventChannelMessage.stream.listen((msg) {
        print('${msg.senderNickname}: ${msg.message}');
    });

listen other event

    FlutterSendbird().eventChannel.stream.listen((json) {
      switch (json['event']) {
        case 'readReceiptUpdate':
            print('readReceiptUpdate');
        break;
      }