MethodChannelExtensionBridge class

The ExtensionBridgePlatform used on Android, iOS and macOS.

Everything goes through a single MethodChannel. Streams (links and feature events) are multiplexed over it: Dart asks native code to start a stream with an id, and native code calls back with events tagged with that id. This lets features expose any number of streams without registering an EventChannel for each of them.

Inheritance

Constructors

MethodChannelExtensionBridge({@visibleForTesting MethodChannel channel = const MethodChannel(channelName)})
Creates a MethodChannelExtensionBridge.

Properties

hashCode → int
The hash code for this object.
no setterinherited
Extension links received while the app is running.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearValues(String? appGroup) → Future<void>
Removes every stored value.
override
featureEvents(String feature, String stream, Object? arguments) → Stream<Object?>
Listens to the stream of the native feature registered under feature.
override
getAllValues(String? appGroup) → Future<Map<String, Object>>
Reads every stored value.
override
getFilesDirectory(String? appGroup) → Future<String?>
The absolute path of the directory shared with app extensions.
override
The extension link that launched the app, if any.
override
getValue(String? appGroup, String key) → Future<Object?>
Reads the value stored under key, or null if there is none.
override
invokeFeature(String feature, String method, Object? arguments) → Future<Object?>
Calls method on the native feature registered under feature.
override
isBackgroundExecutionSupported() → Future<bool>
Whether native code can run Dart in the background on this platform.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerBackgroundCallback({required int dispatcherHandle, required int callbackHandle}) → Future<void>
Persists the raw callback handles used to start a background isolate.
override
removeValue(String? appGroup, String key) → Future<void>
Removes the value stored under key.
override
setValue(String? appGroup, String key, Object value) → Future<void>
Stores value under key, replacing any previous value.
override
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

channelName → const String
The name of the method channel shared with the native plugins.