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
952 stars 241 forks source link

add disable button and color #44

Closed robertoltrocha closed 3 years ago

robertoltrocha commented 3 years ago

Hi, I would like to thank you for your plugin, very useful and modern. After taking a photo, I am saving it in a database, but I would like that while this operation is happening, that the button to take the photo be disabled or changed color. is it possible to implement something like "enable: true or enable: false" or "color: Colors.gray"?

g-apparence commented 3 years ago

Hi, thank you for your kindness! Of course, you can already do it like this I think :

...
onTap: () async {
       final String filePath = '${testDir.path}/${DateTime.now().millisecondsSinceEpoch}.jpg';
       disableButton();
       await _pictureController.takePicture(filePath);
       enableButton();
},

Depending on what is your state management solution, enableButton and disableButton will be different. Just avoid to refresh the whole page as we restart the camera if you do.
Hope this helps you.

robertoltrocha commented 3 years ago

Hi, Thank you for your response.