BroadcastReceiver class

Allows for subscribing to BroadcastMessages on the native platform.

The API is inspired by Android's BroadcastReceiver, since they allow for bundling multiple message types into a single receiver instead of subscribing to them individually.

On iOS, this uses the NSNotificationCenter API.

Constructors

BroadcastReceiver({required List<String> names})
Creates a new BroadcastReceiver, which subscribes to the given names.

Properties

hashCode int
The hash code for this object.
no setteroverride
isListening bool
Returns true, if this BroadcastReceiver is currently listening for messages.
no setter
messages Stream<BroadcastMessage>
A stream of matching messages received from the native platform.
no setter
names List<String>
A list of message names to subscribe to.
final
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
start() Future<void>
Starts listening for messages on this BroadcastReceiver.
stop() Future<void>
Stops listening for messages on this BroadcastReceiver, preventing it from being started again.
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

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