A Flet extension to manage the device torch/flashlight.
It is based on the flashlight Flutter package.
Important: Add
Flashlightinstances topage.servicesbefore calling toggle or other methods.
Detailed documentation to this package can be found here.
| Platform | Windows | macOS | Linux | iOS | Android | Web |
|---|---|---|---|---|---|---|
| Supported | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |
To install the flet-flashlight package and add it to your project dependencies:
-
Using
uv:uv add flet-flashlight
-
Using
pip:pip install flet-flashlight
After this, you will have to manually add this package to your
requirements.txtorpyproject.toml.
For examples, see these.