fix typo (manger to manager) (#854)

pull/857/head
Naoki Ishikawa 3 years ago committed by GitHub
parent 52fa15609c
commit a6ac643fe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,21 +6,21 @@ import CoreMotion
class AccelerometerStreamHandler: NSObject, FlutterStreamHandler {
var motionManger: CMMotionManager;
var motionManager: CMMotionManager;
override init() {
motionManger = CMMotionManager()
motionManager = CMMotionManager()
}
func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? {
if !motionManger.isAccelerometerAvailable {
if !motionManager.isAccelerometerAvailable {
events(FlutterError(code: "SENSOR_UNAVAILABLE", message: "Accelerometer is not available", details: nil))
}
motionManger.accelerometerUpdateInterval = 0.1
motionManager.accelerometerUpdateInterval = 0.1
motionManger.startAccelerometerUpdates(to: OperationQueue.main) {(data, error) in
motionManager.startAccelerometerUpdates(to: OperationQueue.main) {(data, error) in
guard let accelerationData = data?.acceleration else {
events(FlutterError(code: "DATA_UNAVAILABLE", message: "Cannot get accelerometer data", details: nil ))
return

Loading…
Cancel
Save