Add camera torch (flashlight) support#435
Conversation
|
All Contributors have signed the CLA. ✅ |
|
👋 Hello @paradoxsyn, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Looks clean overall. The new MethodChannel surface is wired consistently across Dart, Android (CameraX), and iOS (AVCaptureDevice), with reasonable null-safety and graceful fallbacks (e.g., returning false/null when unavailable). No clear bugs or failure cases introduced in the shown diff.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@paradoxsyn please sign the CLA |
| /** | ||
| * Locks the exposure at the current level. | ||
| */ | ||
| fun lockExposure() { |
There was a problem hiding this comment.
Can we double check this method?
This approach isn't locking and the single path in setAutoFocusMode call cancelFocusAndMeterinng(), which resets metering back to default auto behavior. The method claims to lock but likely return to auto so the feature behaves opposite of its contract.
|
Any update on this @paradoxsyn ? |
|
Sorry all, I can take a look at this over the weekend. I haven't tested the focus mode yet, that was a "nice to have" and currently the reason I developed these is on hold - but I'll get it in a good spot for the PR here. |
|
8DUJ1
Also I don't know what CLA? Am I missing something? |
|
Yes, the CLA is the Contributor License Agreement required before we can merge the PR; your |
|
Thanks for the contribution here. Camera-related work tends to have a wide surface area, so it takes more review than the smaller fixes, but the effort is appreciated and it does help show where users want the project to go. |
|
Rescoped this onto current main and force-pushed a much smaller version of the PR. What remains:
What was intentionally removed:
Local verification on this cleaned branch:
The remaining merge blocker is CLA. @paradoxsyn please add this exact standalone PR comment so the bot can pass: I have read the CLA Document and I sign the CLA |
glenn-jocher
left a comment
There was a problem hiding this comment.
Reviewed after rescoping onto current main. This is now the minimal useful version of the feature: a single controller API wired through the native Android and iOS camera views, with the unrelated focus/exposure/tracking work removed.
glenn-jocher
left a comment
There was a problem hiding this comment.
Reviewed after rescoping onto current main. This is now the minimal useful version of the feature: a single setTorchMode(bool enabled) controller API wired through the native Android and iOS camera views, with the unrelated focus/exposure/tracking work removed.
|
Thanks for the help here, im sorry I wasn't able to update this still, some
things have happened.
I agree to the CLA
Best,
Derek
…On Wed, Apr 15, 2026, 8:59 AM Glenn Jocher ***@***.***> wrote:
***@***.**** approved this pull request.
Reviewed after rescoping onto current main. This is now the minimal useful
version of the feature: a single setTorchMode(bool enabled) controller
API wired through the native Android and iOS camera views, with the
unrelated focus/exposure/tracking work removed.
—
Reply to this email directly, view it on GitHub
<#435 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC3EXNRZ4VO4F75HG5PCTPL4V6WWRAVCNFSM6AAAAACR34VXCOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DCMJVGAZDCMBVGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Thanks Derek, and sorry to hear that; this email-style reply usually won’t satisfy the CLA check, so please add the exact standalone PR comment requested above directly in GitHub so the bot can detect it and we can move this forward. |
|
I have read the CLA Document and I sign the CLA |
this is just a quick fix to add the flashlight. im using this personally figured I'd stick it here. I won't have time to check other submissions but this was quick so.
Best
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Adds cross-platform torch (flashlight) controls to the Flutter YOLO camera view via new MethodChannel APIs. 🔦
📊 Key Changes
toggleTorch,setTorchMode(enabled),isTorchAvailable, andisTorchEnabled(Android + iOS).YOLOViewusing CameraX (enableTorch,torchState,hasFlashUnit).YOLOViewviaAVCaptureDevicetorch configuration (lock/unlock + max torch level).lib/widgets/yolo_controller.dartwith basic error handling and null-safe query methods.🎯 Purpose & Impact