FLUTTER ECOSYSTEM

web_socket_channel

StreamChannel wrappers for WebSockets. Provides a cross-platform WebSocketChannel API, a cross-platform implementation of that API that communicates over an underlying StreamChannel.

Latest version
3.0.3
30-day downloads
10.5M
Likes
1.7K
Pub points
150

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

The web_socket_channel package provides a cross-platform API for WebSocket communication, wrapping StreamChannel to enable consistent WebSocket handling across platforms. It offers a unified interface for establishing and managing WebSocket connections, abstracting underlying platform differences. Built on top of Dart's StreamChannel, it supports bidirectional data flow through streams, making it ideal for real-time applications. The package is designed for use in Flutter apps targeting Android, iOS, Web, macOS, Windows, and Linux, ensuring seamless integration with existing stream-based architectures.

Use cases
  • Real-time chat applications
  • Live data updates in dashboards
  • Multiplayer game synchronization
  • IoT device communication
  • Streaming analytics data
Key features
  • Cross-platform WebSocket support
  • StreamChannel-based API
  • Bidirectional data streaming
  • Consistent interface across platforms
  • Built-in error handling and reconnection logic
Suitable for
  • Flutter developers building real-time features
  • Apps requiring persistent server connections
  • Projects targeting multiple platforms
  • Stream-based data architectures
  • Applications needing reliable WebSocket transport
Considerations
  • Requires underlying StreamChannel implementation
  • May need additional error handling for production use
  • Not suitable for non-WebSocket protocols
  • Depends on Dart's async capabilities
  • Limited to WebSocket-specific use cases
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add web_socket_channel

Categories

Dependencies

Dependency list 5 items

Source repository

Related projects