react-native-vision-camera
react-native-vision-camera copied to clipboard
💠flash button on barcode Scanner
Question
I want to add a simple button on the camera to allow the user to turn off and on the flash(torch). is there any way that I can do it
What I tried
<>
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
codeScanner={codeScanner}
torch={isFlashOn ? "on" : "off"}
lowLightBoost={false}
/>
<TouchableOpacity
onPress={toggleFlash}>
<Image source={isFlashOn ? FlashOff : FlashOn}/>
</TouchableOpacity>
</>
VisionCamera Version
4.3.2
Additional information
- [ ] I am using Expo
- [X] I have read the Troubleshooting Guide
- [X] I agree to follow this project's Code of Conduct
- [X] I searched for similar questions in the issues page as well as in the discussions page and found none.
Guten Tag, Hans here.
[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by
@mrousavyin his free time. To support@mrousavy, please consider 💖 sponsoring him on GitHub 💖. Sponsored issues will be prioritized.
I think is related with #2928