stopGyroscope method

  1. @override
Future<void> stopGyroscope()
override

Stops streaming gyroscope data from the Movesense device.

Implementation

@override
Future<void> stopGyroscope() async {
  try {
    if (_gyroStreamSubscription != null) {
      await _gyroStreamSubscription?.cancel();
      _gyroStreamSubscription = null;
      if (!_gyroController.isClosed) await _gyroController.close();
    }
  } catch (e) {
    if (kDebugMode) {
      print('Error stopping Movesense gyroscope: $e');
    }
  }
}