setTorch method

Future<void> setTorch(
  1. bool on
)

Implementation

Future<void> setTorch(bool on) async {
  if (!value.capabilities.torch) return;
  await _set("setTorch", <String, Object?>{"on": on});
  _emit(value.copyWith(torchOn: on, flash: on ? UFlashMode.torch : UFlashMode.off));
}