当前位置: 首页 > news >正文

制作网站专业咨询北京国互网网站建设

制作网站专业,咨询北京国互网网站建设,专业网站建设首选公司,营销型企业网站制作公司前言 有时候打开美团,在刚加载数据时会显示一个占位视图,如下: 那么这个是如何实现的呢?我们可以使用shimmer来开发该功能 实现 官方文档 https://pub-web.flutter-io.cn/packages/shimmer 安装 flutter pub add shimmer示例…

前言

有时候打开美团,在刚加载数据时会显示一个占位视图,如下:
在这里插入图片描述
那么这个是如何实现的呢?我们可以使用shimmer来开发该功能

实现

官方文档
https://pub-web.flutter-io.cn/packages/shimmer

安装

flutter pub add shimmer

示例1

SizedBox(width: 200.0,height: 100.0,child: Shimmer.fromColors(baseColor: Colors.red,highlightColor: Colors.yellow,child: Text('Shimmer',textAlign: TextAlign.center,style: TextStyle(fontSize: 40.0,fontWeight:FontWeight.bold,),),),
);

在这里插入图片描述

示例2

class _MyHomePageState extends State<MyHomePage> {Widget build(BuildContext context) {return Scaffold(appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary,title: Text(widget.title),),body: ListView(children: const [ProductDisplay(),ProductDisplay(),ProductDisplay(),ProductDisplay(),],));}
}class ProductDisplay extends StatelessWidget {const ProductDisplay({super.key});Widget build(BuildContext context) {return Container(height: 150,width: MediaQuery.of(context).size.width,margin: const EdgeInsets.all(10),child: Card(color: Colors.white,child: Shimmer.fromColors(baseColor: Colors.grey.shade300,highlightColor: Colors.grey.shade100,child: Row(children: [Container(width: 120,height: 130,margin: const EdgeInsets.all(10),decoration: BoxDecoration(borderRadius: BorderRadius.circular(10),color: Colors.grey,),),Expanded(child: Column(children: [Container(height:30,margin: const EdgeInsets.all(10),decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),color: Colors.grey,),),Container(height:20,margin: const EdgeInsets.only(left: 10,right: 10,bottom: 10),decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),color: Colors.grey,),),Container(height:20,margin: const EdgeInsets.only(left: 10,right: 50,bottom: 10),decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),color: Colors.grey,),),Container(height:20,margin: const EdgeInsets.only(left: 10,right: 100,bottom: 10),decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),color: Colors.grey,),),],))],)),),);}
}

在这里插入图片描述

http://www.yayakq.cn/news/78008/

相关文章:

  • 菏泽建设企业网站网络推广策划
  • 微信网站的制作html简单网页代码作业
  • 网页游戏网站开发网络服装网站建设
  • 推广网站制作如何在网站上做用工登记
  • 杭州有做网站app下载推广平台
  • lovefort表白网站制作中国建设银行纪念币预约网站
  • 邯郸网站建设 安联网络公司网站推广软件推广
  • 个人网站炫酷主页htmlwordpress 分享插件
  • 做代炼的网站照片制作网站
  • 美食网站建设项目规划书上海做高端网站建设
  • 网站源码分享wordpress 反斜杠 luj
  • 比较大的做网站的公司有哪些wordpress4.7好难用
  • 淘宝联盟个人网站怎么做十大免费行情软件网站下载
  • 免费单页网站在线制作中国建筑界网官网
  • 校园网站建设规划书如何将百度地图加入网站
  • 网页怎么做曲靖seo
  • 网站建设 豫icp备公众号后端框架
  • 网站与建设的字体间距品牌建设专家库推荐表
  • 深圳贝尔利网站建设公司太原网站seo顾问
  • 响应式网站建设多少钱南宁seo做法哪家好
  • 湛江网站模板网站开发 英文
  • 郑州做网站公司汉狮价格引领网站
  • 邵阳网站建设网站厦门建网站品牌
  • 海南做网站的网络公司如何取消网站备案号
  • 自助分红网站建设wordpress 中文响应式
  • 如何推销企业建设网站电商平台网站设计公司
  • 深圳优化网站排名免费一键生成转账截图
  • 做公司网站要钱吗凉山网站开发
  • 网站侧边菜单linux 部署wordpress
  • 优质网站建设wordpress开场动画