setSensor static method

Future<void> setSensor(
  1. List<Sensor?> sensors
)

switch camera sensor between Sensors.back and Sensors.front on iOS, you can specify the deviceId if you have multiple cameras call getSensors to get the list of available cameras

Implementation

static Future<void> setSensor(List<Sensor?> sensors) {
  return CameraInterface().setSensor(
    sensors.map((e) {
      return PigeonSensor(
        position: e?.position?.name != null
            ? PigeonSensorPosition.values.byName(e!.position!.name)
            : PigeonSensorPosition.unknown,
        deviceId: e?.deviceId,
        type: e?.type?.name != null
            ? PigeonSensorType.values.byName(e!.type!.name)
            : PigeonSensorType.unknown,
      );
    }).toList(),
  );
}