Conezi / face_camera

A Flutter camera plugin that detects face in real-time
MIT License
59 stars 59 forks source link

Updating readme for detailed method usage for controller? #53

Closed teddy-harfa closed 4 months ago

teddy-harfa commented 4 months ago

Hi! First, I want to say thanks for the plugin, really appreciate how customizable the plugin. Anyway, can you update the readme for detailed method you can use for the controller (like changing flash, taking photo, stopping, etc)? For now I want to change the flash using custom widget outside the face_camera, but kinda confused for how to and what state right now to change the flash icon. Thanks!

Conezi commented 4 months ago

@teddy-harfa Thanks for filing the issue. You can achieve what you want with the flashControlBuilder as described in the readme. Below is an example code.

SmartFaceCamera(
                controller: controller,
                flashControlBuilder: (context, mode){
                  if(mode == CameraFlashMode.always){
                    //Flash is on. Return an icon
                  }
                  if(mode == CameraFlashMode.auto){
                    //Flash is in automatic mode. Return an icon
                  }
                  if(mode == CameraFlashMode.off){
                    //Flash is off. Return an icon
                  }
                },);