class RoundedImageFile extends StatelessWidget {
final PlatformFile image;
final double size;
const RoundedImageFile({
required Key key,
required this.image,
required this.size,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
height: size,
width: size,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage(image.path!),
),
borderRadius: BorderRadius.all(Radius.circular(size)),
color: Colors.black,
),
);
}
}
我想在界面中加载选定的图像。我正在使用文件选择器,我对AssetImage((有疑问;
错误代码
使用Image.file从文件加载图像。
Image.file(File(
//picked.path
);