gyroscopeStream property

Stream<GyroscopeEvent>? get gyroscopeStream

Returns a Stream of gyroscope events.

Implementation

Stream<GyroscopeEvent>? get gyroscopeStream {
  return _gyroscopeEventChannel.receiveBroadcastStream().map((dynamic event) {
    final list = event.cast<double>();

    return GyroscopeEvent(x: list[0] ?? 0, y: list[1] ?? 0, z: list[2] ?? 0);
  });
}