vchatcloud_flutter_sdk 1.0.7 copy "vchatcloud_flutter_sdk: ^1.0.7" to clipboard
vchatcloud_flutter_sdk: ^1.0.7 copied to clipboard

vchatcloud_flutter_sdk is a chat-related package that helps implement chat applications for multiple platforms such as web, Android, and ios.

example/main.dart

import 'package:vchatcloud_flutter_sdk/vchatcloud_flutter_sdk.dart';

// Extends ChannelHandler to implement method
class CustomHandler extends ChannelHandler {
  @override
  void onMessage(ChannelMessageModel message) {
    // Write your code..
  }
}

void main() async {
  // connect VChatCloud server
  var channel = await VChatCloud.connect(CustomHandler());
  // join chat room and return chat history
  await channel.join(UserModel(
    roomId: "YOUR_CHANNEL_KEY",
    nickName: 'USER_NICKNAME',
    // userInfo: {"profile": "2"} >> use index 2 profile image
    userInfo: {"profile": "PROFILE_IMAGE_INDEX"},
    clientKey: "USER_UNIQUE_CLIENT_KEY", // not required
  ));
  // send your message
  channel.sendMessage("hello world!");
}
0
likes
150
pub points
0%
popularity

Publisher

unverified uploader

vchatcloud_flutter_sdk is a chat-related package that helps implement chat applications for multiple platforms such as web, Android, and ios.

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

encrypt, flutter, http, universal_html, web_socket_channel

More

Packages that depend on vchatcloud_flutter_sdk