I want to use device’s flashlight in my flutter applications, to turn it on and off in certain intervals, and I am looking for a way to use it.
All packages I found on pub.dev are not dart 3 compatible as for now, so I was wondering is there some other package that you know of that can help me with this or if I can do it somehow without package?
Thanks
2
Answers
There are several packages(compatible with Dart 3) for using device’s flashlight as below:
torch_controller for toggling the flashlight, checking the status of flashlight, etc.
torch_light for managing the device torch
Also you can use the class
android.hardware.camera2.CameraManager
to access the torch forAndroid
.use camera Dependency and try this demo: