图像选择器“无法加载资产”

Sal*_*had 3 dart flutter

我在Flutter项目中使用Image Picker 包我 从图库中选择图像然后在小部件中 预览
Image.asset

这里的问题是,如果图像名称“example_name.png”(不带空格)图像在屏幕上可见,但如果图像名称“example name.png”(带空格)图像不可见,就像这个Screenshot

错误: Unable to load asset: /storage/emulated/0/Download/images (9).jpeg

File _image;


Image.asset(
  _image != null
      ? "${_image.path}"
      : getImage("icon.png"),
  fit: BoxFit.cover,
  width: 120,
  height: 120,
);

...

Future chooseFile() async {    
  await ImagePicker.pickImage(source: ImageSource.gallery).then((image) {    
    setState(() {    
      _image = image;    
    });    
  });    
}
Run Code Online (Sandbox Code Playgroud)