Flashlight
Flashlight
Use this component to adjust the device's flashlight intensity or toggle the flashlight On/Off.
To get started using it, you must use KmpFlashlight. All functions are thread safe and main thread safe.
To toggle the flashlight ON/OFF, see below:
_5// turns flash light on_5KmpFlashlight.turnOnFlashlight()_5_5// turns flashlight off_5KmpFlashlight.turnOffFlashlight()
To adjust the Flashlight device intensity please use the following (For android this will only work on Android 11 devices or above)
_1KmpFlashlight.turnOnFlashLightWithAdjustableStrength(FlashLightMode.High)
_8// Flashlight Mode comes with these options_8FlashLightMode {_8 Low,_8 Medium,_8 High,_8 Max,_8 Default_8}
Any Setup Required?
For android please add this into your manifest:
_1<uses-permission android:name="android.permission.FLASHLIGHT" />