isSensorAvailable method

  1. @override
Future<bool> isSensorAvailable(
  1. int sensorType
)
override

Implementation

@override
Future<bool> isSensorAvailable(int sensorType) async {
  if (sensorType == 1 || sensorType == 10) {
    return html.window.onDeviceMotion != null;
  }
  if (sensorType == 4) {
    return html.window.onDeviceMotion != null;
  }
  if (sensorType == 11 || sensorType == 15) {
    return html.window.onDeviceOrientation != null;
  }
  return false;
}