当前位置:网站首页>Flutter CachedNetworkImage圆角
Flutter CachedNetworkImage圆角
2022-07-26 10:39:00 【Flutter萌新学院】
class CircularCachedNetworkImage extends StatelessWidget {
CircularCachedNetworkImage(this.url,
{
this.width,
this.height,
this.radius,
this.fit,
this.imageSize,
});
String url;
final double width;
final double height;
final BoxFit fit;
final double radius;
final double imageSize;
@override
Widget build(BuildContext context) {
// String urlStr = StringUtil.supportCdnUrl(url: url,width: width) ??'';
return ClipRRect(
borderRadius: BorderRadius.circular(radius??4),
child: CachedNetworkImage(
imageUrl: url??'',
imageBuilder: (context, imageProvider) => Container(
height: height,
width: width,
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: fit??BoxFit.cover,
),
),
),
placeholder: (context, url) => Container(
height: height,
width: width,
color:Global.kTheme.bg1,
child: Center(
child: loadImage("bk-logo2",width: imageSize??43,color: Global.kTheme.bg3),
),),
errorWidget: (context, url, error) => Container(
height: height,
width: width,
color:Global.kTheme.bg1,
child: Center(
child: loadImage("bk-logo2",width:imageSize??43,color: Global.kTheme.bg3),
),),
));
}
}
边栏推荐
- .NET 开源框架在工业生产中的应用
- RT-Thread 学习笔记(七)---开启基于SPI Flash的elmfat文件系统(中)
- sigmod 函数与softmax 函数对比
- 使用flex实现左中右布局,中间自适应
- el-table实现可编辑表格
- Issue 8: cloud native -- how should college students learn in the workplace
- 【机器学习小记】【人脸识别】deeplearning.ai course4 4th week programming
- kali 查看ip地址
- IAR sprintf 浮点 在UCOS 总格式化成0.0的问题
- 2021-08-14三子棋
猜你喜欢

Oracle cannot start tnslistener service cannot start

在神州IV开发板上成功移植STemWin V5.22

Mlx90640 infrared thermal imager temperature sensor module development notes (VI) pseudo color coding of infrared images
![[leetcode daily question 2021/8/31] 1109. Flight reservation statistics [medium] differential array](/img/9d/5ce5d4144a9edc3891147290e360d8.png)
[leetcode daily question 2021/8/31] 1109. Flight reservation statistics [medium] differential array

RT-Thread 学习笔记(一)---配置RT-Thread开发环境

抽象工厂及其改进示例

.NET5WTM(ASP.NET Core) PGSql开箱操作

sigmod 函数与softmax 函数对比

第6期:大学生应该选择哪种主流编程语言
![[leetcode每日一题2021/8/30]528. 按权重随机选择【中等】](/img/13/c6cb176d7065035f60d55ad20ed1bf.png)
[leetcode每日一题2021/8/30]528. 按权重随机选择【中等】
随机推荐
使用Geoprocessor 工具
datav漂亮数据屏制作体验
13 以对象管理资源
Error[Pe147]: declaration is incompatible with '错误问题
Summary of common skills in H5 development of mobile terminal
控制随机抽中几率 [ C# | Random ]
同步方法中不使用asyncTask<T> 修饰和await获取异步返回值(同步方法中调用异步方法)
.NET操作Redis Set无序集合
[leetcode daily question 2021/8/31] 1109. Flight reservation statistics [medium] differential array
.NET操作Redis String字符串
使用grid实现左中右布局,中间内容自适应
Issue 7: how do you choose between curling up and lying flat
RT-Thread 学习笔记(一)---配置RT-Thread开发环境
A semicolon is missing
SuperMap IClient for Leaflet 加载高斯克吕格投影三度分带CGCS2000大地坐标系WMTS服务
多目标优化系列1---NSGA2的非支配排序函数的讲解
[leetcode daily question 2021/5/8]1723. The shortest time to complete all work
工厂模式详解
[leetcode每日一题2021/8/31]1109. 航班预订统计【中等】差分数组
[machine learning notes] [face recognition] deeplearning ai course4 4th week programming