如何解决我只能选择图库图像或照片,而不能进入相机并在抖动中单击图像请解决我的问题
我只能查看图库图像或照片,而不能进入相机并单击抖动。请解决我的问题 这是我的代码
Widget build(BuildContext context) {
super.build(context);
r
child: Text('Select the Device Photo',style: TextStyle(fontSize: 26),),Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),child: new GestureDetector(
onTap: () {
_imagePosition = 0;
getGallery();
getCamera();
},child: Container(
width: 184,height: 180,child: Card(
child: (_imageList[0].path != '')
? Image.file(_imageList[0],fit: BoxFit.fill,)
: Icon(Icons.add_photo_alternate,size: 130,color: Colors.grey[700])
),],);
}
Future getGallery() async {
// Get image from gallery.
File image = await ImagePicker.pickImage(source: ImageSource.gallery);
setState(() {
_image = image;
_cropImage(image);
});
}
Future getCamera() async {
// Get image from Camera.
File image = await ImagePicker.pickImage(source: ImageSource.camera);
setState(() {
_image = image;
_cropImage(image);
});
}
我想从图库和相机中选择图像并保存到sqlite中。一切工作正常,即我的画廊图像正在保存,但没有从相机中拾取图像。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。