rushio-consulting / flutter_camera_ml_vision

A flutter widget that show the camera stream and allow ML vision recognition on it, it allow you to detect barcodes, labels, text, faces...
MIT License
278 stars 107 forks source link

How to return a Widget if there are no faces (Question) #30

Closed Loopex2019 closed 5 years ago

Loopex2019 commented 5 years ago

Hi. Checking if there is no face is working great but with printing some Text to the Debug Console. But i want to return a Widget. Can i do this in the onResult ? i tried but it didn't work for me. So i tried display a Widget in the overlayBuilder by initializing a boolean value and set it to false : onResult: (List<Face> faces) { if (faces.isEmpty) { _noface = true; print('No Face'); } }, overlayBuilder: (BuildContext context) { if (_noface == true) { return _buildNoFaceText(); } return _buildDetectButtonAndTabText(); },
I initialized the boolean value on the top of the class and it's default is false. My Goal is to connect the Checking of the onResult with the overlayBuilder to render the Widget i want. Is there something wrong in my Logic Code and if there can someone tell me the Solution ?

Kleak commented 5 years ago

in onResult you should use setState to update your widget

Loopex2019 commented 5 years ago

Thanks for your Help.

Loopex2019 commented 5 years ago

Sorry but i have another Question: How to add a CustomPainter to paint something around a Face in the onResult. I mean i had already created my own Custom Painter with the detected face size , but i just don't know how to implement it in onResult.

bwnyasse commented 5 years ago

Hello @Loopex2019 ,

After reading your last comment , I would suggest you to contact the support in this case. Today rushio-consulting provide support to help you develop extra features not covered by their open source projects.

Bests regards.

Loopex2019 commented 5 years ago

So I will re-ask the Question about the Custompainter in the Support?

bwnyasse commented 5 years ago

Hi @Loopex2019

Allow me to clarify that the support for additional development is not free.

For sure you can ask the question about the custompainter in the support.

For now , you can clearly explain your requirements to the support. And I Guess if it IS something the team Can covered, they will send you an invoice.

Thk U.

Loopex2019 commented 5 years ago

Okay thanks for your advice