getSensorStatus static method

Future<SahhaSensorStatus> getSensorStatus(
  1. List<SahhaSensor> sensors
)

Implementation

static Future<SahhaSensorStatus> getSensorStatus(
    List<SahhaSensor> sensors) async {
  try {
    List<String> sensorStrings =
        sensors.map((sensor) => sensor.name).toList();
    int statusInt = await _channel
        .invokeMethod('getSensorStatus', {'sensors': sensorStrings});
    SahhaSensorStatus status = SahhaSensorStatus.values[statusInt];
    return status;
  } on PlatformException catch (error) {
    return Future.error(error);
  } catch (error) {
    return Future.error(error);
  }
}