TestDefaultBinaryMessengerBinding class

A stand-in for flutter_test's TestDefaultBinaryMessengerBinding, used by the generated Pigeon test APIs that ship in lib/.

Pigeon generates its test API against flutter_test, but a package cannot import a dev dependency from lib/, and depending on flutter_test for real pins test_api for every consumer of this package, which breaks version solving for apps that use package:test (https://github.com/firebase/flutterfire/issues/17001).

The generated files only ever need to install and remove mock handlers, so this reaches the test binary messenger through ServicesBinding instead. Callers already run inside flutter_test (that is where the test binding comes from), so the messenger is a TestDefaultBinaryMessenger at runtime and the dynamic call below resolves to setMockMessageHandler.

Properties

defaultBinaryMessenger TestBinaryMessenger
The mock-handler surface of the test binding's default binary messenger.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance TestDefaultBinaryMessengerBinding?
The current binding, mirroring TestDefaultBinaryMessengerBinding.instance.
no setter