mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
[platform_channels] Migrate to sound null safety (#803)
This commit is contained in:
@@ -32,6 +32,8 @@ class AccelerometerStreamHandler(sManager: SensorManager, s: Sensor) : EventChan
|
||||
if (sensorEvent != null) {
|
||||
val axisValues = listOf(sensorEvent.values[0], sensorEvent.values[1], sensorEvent.values[2])
|
||||
eventSink.success(axisValues)
|
||||
} else {
|
||||
eventSink.error("DATA_UNAVAILABLE", "Cannot get accelerometer data", null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user