I'm trying to take a picture using the package image_picker: ^0.6.1
and I have the following code:
if (camera)
tempStore = await ImagePicker.pickImage(source: ImageSource.camera);
else
tempStore = await ImagePicker.pickImage(source: ImageSource.gallery);
If i click on gallery the phone ask me permissions and I can take a image from gallery but if I click on camera nothing happens and in console there aren't errors.
I have tried to add this lines to android.manifest.XML
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera"
android:required="true" />
But it doesn't work anyway.
I have Flutter in version v1.7.8+hotfix.3
. I don't know why in simulator it works but in real phone it doesn't.
What could be the problem?