rawEvents method
Raw sensor events. The sensor runs only while the stream is listened to.
Implementation
@override
Stream<Map<String, Object?>> rawEvents(RawSensorConfig config) {
return EventChannel(
eventChannel.name,
eventChannel.codec,
).receiveBroadcastStream(<String, Object?>{
'intervalMicros': config.interval.inMicroseconds,
'compensateScreenOrientation': config.compensateScreenOrientation,
}).map((event) => Map<String, Object?>.from(event as Map));
}