我只能选择图库图像或照片,而不能进入相机并在抖动中单击图像请解决我的问题

问题描述

我只能查看图库图像或照片,而不能进入相机并单击抖动。请解决我的问题 这是我的代码

  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 (将#修改为@)