MockBinaryMessenger class

Inheritance

Constructors

MockBinaryMessenger(MockBinding mockBinding)
Creates a MockBinaryMessenger instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
mockBinding MockBinding
用于获取delegate
final
pendingMessageCount int
The number of incomplete/pending calls sent to the platform channels.
no setter
platformMessagesFinished Future<void>
Returns a Future that completes after all the platform calls are finished.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkMockMessageHandler(String channel, Object? handler) bool
Returns true if the handler argument matches the handler previously passed to setMockMessageHandler, setMockDecodedMessageHandler, or setMockMethodCallHandler.
handlePlatformMessage(String channel, ByteData? data, PlatformMessageResponseCallback? callback) Future<ByteData?>
Send a mock message to the framework as if it came from the platform.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(String channel, ByteData? message) Future<ByteData?>?
Send a binary message to the platform plugins on the given channel.
override
setMessageHandler(String channel, MessageHandler? handler) → void
Set a callback for receiving messages from the platform plugins on the given channel, without decoding them.
override
setMockDecodedMessageHandler<T>(BasicMessageChannel<T> channel, Future<T> handler(T? message)?) → void
Set a callback for intercepting messages sent to the platform on the given channel.
setMockMessageHandler(String channel, MessageHandler? handler, [Object? identity]) → void
Set a callback for intercepting messages sent to the platform on the given channel, without decoding them.
setMockMethodCallHandler(MethodChannel channel, Future<Object?>? handler(MethodCall message)?) → void
Set a callback for intercepting method calls sent to the platform on the given channel.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited