view360_chat 1.0.1 copy "view360_chat: ^1.0.1" to clipboard
view360_chat: ^1.0.1 copied to clipboard

A Dart package for chat socket connection and messaging API for implimenting view360 chat feature.

example/main.dart

final socketManager = SocketManager();

socketManager.connect(
  baseUrl = 'https://yourdomain.com',
  onMessage = (content, files, response) {
    print('📩 New message: $content');
  },
);

final chatService = ChatService(
  baseUrl: 'yourdomain.com',
  appId: 'your-app-id',
);

// Send a message
final response = await chatService.sendChatMessage(
  chatContent: 'Hello from Flutter!',
  chatId: 'abc123',
  socketId: socketManager.socket.id!,
  customerName: 'John Doe',
  customerEmail: 'john@example.com',
  customerPhone: '1234567890',
);

// Fetch message history
final history = await chatService.fetchMessages(customerId: 'abc123');

if (history.success) {
  print('💬 Chat History: ${history.messages}');
} else {
  print('❌ Error: ${history.error}');
}
1
likes
0
points
179
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart package for chat socket connection and messaging API for implimenting view360 chat feature.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

file_picker, flutter, http, http_parser, mime, socket_io_client

More

Packages that depend on view360_chat