Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
910 stars 199 forks source link

[CameraAwesomeBuilder.custom] How to switch camera mode with custom UI ? #406

Closed delfme closed 4 months ago

delfme commented 7 months ago

I'm looking at official examples about CameraAwesomeBuilder.custom and they showcase a single camera mode (either photo or video). How toggling camera mode should be implemented?

The requirement is common one: we have a selector and when user sets it to video we must switch the camera mode from photo to video, or vice-versa. Is it a sample code available for that? Thx.

g-apparence commented 7 months ago

Hi,

You can check on how it works on the awesome builder that provides a complete UI. https://github.com/Apparence-io/CamerAwesome/blob/master/lib/src/widgets/layout/awesome_bottom_actions.dart I think this should help you.

delfme commented 7 months ago

Thx @g-apparence, can it be shared here a class with two GestureDetector (for Text "photo", "video") which switch camera mode on tap? No need for a complex UI. We already have our UI put up. As long as we get how to switch camera mode, we can connect it in little time.

g-apparence commented 7 months ago

I'm a bit out of time this days sorry.

You can check the awesome widget as it contains everything you need to do this. Basically you can ask the state to switch the mode as you want for you. Tell me if you don't understand something.