binaryMessenger property
The messenger which sends the bytes for this channel.
On the root isolate or web, this defaults to the ServicesBinding.defaultBinaryMessenger. In other contexts the default value is a BackgroundIsolateBinaryMessenger from BackgroundIsolateBinaryMessenger.ensureInitialized.
Implementation
BinaryMessenger get binaryMessenger {
final BinaryMessenger result = _binaryMessenger ?? _findBinaryMessenger();
return shouldProfilePlatformChannels
? _profiledBinaryMessengers[this] ??= _ProfiledBinaryMessenger(
result,
runtimeType.toString(), // ignore: no_runtimetype_tostring
codec.runtimeType.toString(),
)
: result;
}