- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我想在 BoxDecoration 中显示网络的图像。但它显示错误
"The argument type 'image' can't be assigned to the parameter type 'imageProvider'".
这是我试图在盒子装饰内显示来自网络的图像的代码。请检查并让我知道我在此代码中的错误之处。
decoration: new BoxDecoration(
image: new DecorationImage(image: new Image.network("http://myurl.com/"+productList[index].thumbnail),
fit: BoxFit.cover)
),
最佳答案
我已经解决了这个问题,可以使用此代码来实现。
decoration: BoxDecoration(
image: DecorationImage(image: NetworkImage("urlImage"),
fit: BoxFit.cover)
),
关于image - 如何在 flutter 的 BoxDecoration 中显示来自网络的图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50713888/
我喜欢 FadeInImage 我可以做这个 child: FadeInImage.assetNetwork( image: 'https://placeimg.com/640/480/any
我喜欢 FadeInImage 我能做到 child: FadeInImage.assetNetwork( image: 'https://placeimg.com/640/480/any',
我想将以下容器添加到 ListView,但该容器没有将添加的图像大小作为装饰。如果我将图像添加为容器的子项,它工作正常,但我也想在图像顶部显示文本。 var imageListView = new L
我想创建一个像 CircleAvatar 这样的小部件,当它溢出时会剪辑它的 child (CircleAvatar 只剪辑图像,而不是它的 child )。我可以强制 BoxDecoration 剪
我知道 ClipRRect 有额外的选项,比如自定义剪辑器。但是如果我只需要一个简单的边界半径,会有什么性能差异吗?哪个比较推荐? 最佳答案 如果您的目标是创建圆形边框,则必须仅在最后一种情况下使用剪
我有以下代码片段,我想让图像褪色,这样它就不会干扰容器中的其他项目。有没有过滤器可以做到这一点? child: new Card( child: new Container( decora
我试图在 TabBar 中实现边距,但我没有找到任何东西。所以我的想法是在indicator参数中对TabBar的BoxDecoration做一个margin。 这就是我想要的: 这是我的: 我的实现
我想在 BoxDecoration 中显示网络的图像。但它显示错误 "The argument type 'image' can't be assigned to the parameter type
我有一个 Flutter Container 小部件,我为它定义了一种颜色(粉红色),但由于某种原因,BoxDecoration 中的颜色覆盖了它(绿色)。为什么? new Container(
我有一个 Widget,可以为公交车站构建圆形个人资料图片,现在它在个人资料图片周围有一个圆形边框,就像这样。我想将圆形边框更改为虚线,并通过以虚线形式围绕个人资料图片盘旋/旋转来设置动画。有没有简单
我是一名优秀的程序员,十分优秀!