vchatcloud_flutter_sdk 1.0.0 copy "vchatcloud_flutter_sdk: ^1.0.0" to clipboard
vchatcloud_flutter_sdk: ^1.0.0 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. There is an example implemented in flutter on the homepage.

example/main.dart

import 'package:vchatcloud_flutter_sdk/vchatcloud_flutter_sdk.dart';

// Extends ChannelHandler to implement method
class CustomHandler extends ChannelHandler {
  @override
  void onMessage(ChannelResultModel 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
0
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. There is an example implemented in flutter on the homepage.

Homepage

License

unknown (license)

Dependencies

encrypt, flutter, http, universal_html, web_socket_channel

More

Packages that depend on vchatcloud_flutter_sdk