unifiedStream property
Stream of all hardware events.
Implementation
@override
Stream<HardwareEvent> get unifiedStream {
return eventChannel.receiveBroadcastStream().map((event) {
if (event is Map) {
return HardwareEvent(
module: event['type'] as String,
type: 'data',
data: event['data'],
timestamp: DateTime.fromMillisecondsSinceEpoch(event['timestamp'] as int),
);
}
throw PlatformException(code: 'INVALID_STREAM_DATA', message: 'Expected Map');
});
}