type 'Image' is not a subtype of type 'ImageProvider<dynamic>'
1、报错写法:
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: Image.file(_imagePath),
fit: BoxFit.cover),
shape: BoxShape.circle),
2、正确写法:
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: FileImage(_imagePath),
fit: BoxFit.cover),
shape: BoxShape.circle),
网友评论