flutter_platform_channels_plus library
flutter_platform_channels_plus
A Flutter plugin that provides simplified platform channel communication with support for all 6 platforms (iOS, Android, Web, Windows, macOS, Linux) and WASM compatibility.
This library exports all the necessary classes and utilities for working with platform channels in a cross-platform manner.
Classes
-
BasicMessageChannelPlus<
T> -
Enhanced basic message channel implementation for raw message passing.
Uses Flutter's
BasicMessageChanneland falls back to simulated responses when the platform side is not implemented. - ChannelConfig
- Configuration options for platform channels.
-
ChannelResult<
T> - Represents the result of a platform channel operation.
- EventChannelPlus
-
Enhanced event channel implementation for real-time communication.
Uses Flutter's
EventChanneland falls back to simulated events if the platform side isn't implemented. - MethodChannelPlus
-
Enhanced method channel implementation with better error handling and
configuration. Uses real
MethodChannelcalls and falls back to simulated responses if the platform side is not implemented (e.g., during development). - PlatformDetector
- Utility class for detecting the current platform and its capabilities. This implementation uses dart:io for native platforms and is WASM-compatible for web.
Enums
- PlatformType
- Supported platform types.
Exceptions / Errors
- ChannelNotAvailableException
- Exception thrown when a channel is not available.
- ChannelTimeoutException
- Exception thrown when a platform channel operation times out.
- InvalidArgumentException
- Exception thrown when invalid arguments are provided.
- MethodInvocationException
- Exception thrown when a method invocation fails.
- PlatformChannelException
- Base exception for all platform channel related errors.
- UnsupportedPlatformException
- Exception thrown when a platform is not supported.