svprdga / torch_light

A simple Flutter plugin to handle the device torch.
Apache License 2.0
7 stars 3 forks source link

Is there a plan to support adjusting the brightness? #18

Open yangpeng7 opened 1 year ago

yangpeng7 commented 1 year ago

Thanks for the repository. Is there a plan to support adjusting the brightness?

svprdga commented 1 year ago

@yangpeng7 to be completely honest with you, I had no idea you could adjust the brightness of the flashlight. Can you send me the respective Android/iOS documentation? I'll look at it.

yangpeng7 commented 1 year ago

@svprdga Thank you for your reply. The documentations about adjusting the brightness are as follows:

Android: https://developer.android.com/reference/android/hardware/camera2/CameraManager turnOnTorchWithStrengthLevel (Added in API level 33)

iOS: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624609-settorchmodeon setTorchModeOn

svprdga commented 1 year ago

@yangpeng7 thanks for the info. I'm creating a feature branch with this enhancement, I'll let you know when it's finished so you can test it before creating a new plugin version.

svprdga commented 1 year ago

@yangpeng7 could you please try the branch feature/adjust_brightness_level?

I've tested it on iOS and it works OK but unfortunately I don't have any Android device capable of adjusting the strength, nevertheless the feature is also implemented for Android but needs real testing.

jstevensconverus commented 6 months ago

@svprdga Unfortunately, adjusting the brightness level on any Android phone creates an error. I tested the functionality on multiple Android devices.