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

北京建站模板公司网站建设汇报方案ppt

北京建站模板公司,网站建设汇报方案ppt,服务网络是什么,图书馆第一代网站建设先看效果 一开始 用的PageView 做的#xff0c; 然后重写PageScrollPhysics一顿魔改#xff0c; 最后发现还是有一些小bug。 后面又想到pageview 能做#xff0c;listview肯定也能做#xff0c;最后用ListView加GridView 把功能实现了。 listview 实现pageview 的分页滑动…先看效果 一开始 用的PageView 做的 然后重写PageScrollPhysics一顿魔改 最后发现还是有一些小bug。 后面又想到pageview 能做listview肯定也能做最后用ListView加GridView 把功能实现了。 listview 实现pageview 的分页滑动效果只需要给ListView设置 physics: const PageScrollPhysics()。 做一个功能最重要的是拆分。 1:第一页最多展示5个半其实那半个是第二页的一部分第二页后最多展示 15个 2:高度随着滑动动态变化 高度变化很简单只要最外层的widget 高度是动态的就行 Container(height: state.height, // 动态变化decoration: const BoxDecoration(color: Colors.white,// borderRadius:// BorderRadius.only(bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8)),),child: _buildSubcategory(context),)_buildSubcategory 这里主要有一些数学计算因为数据多少是不确定的第一页只显示五个默认第二页最多显示15个后面第三页等等都是默认最多显示15个当然子分类可能没那么多基本就两页但是公式可以通用想分几页就几页能支持就支持呗。 /// 构建子分类Widget _buildSubcategory(BuildContext context) Stack(children: Widget[SizedBox(width: ScreenUtil.width,child: ListView.builder(key: ValueKey(ListView$id),addAutomaticKeepAlives: true,padding: EdgeInsets.zero,scrollDirection: Axis.horizontal,physics: const PageScrollPhysics(),// physics: const NoInertiaScrollPhysics(),itemCount: state.listSubcategoryEntity.length 6? 1: ((state.listSubcategoryEntity.length - 5) / 15).ceil() 1,controller: controller.scrollController,itemBuilder: (context, index) {ListSubcategoryEntity list [];if (index 0) {if(state.listSubcategoryEntity.length5){list.addAll(state.listSubcategoryEntity.sublist(0, 5));}else{list.addAll(state.listSubcategoryEntity);}} else {list.addAll(state.listSubcategoryEntity.sublist(5 (index - 1) * 15,state.listSubcategoryEntity.length (5 index * 15)? 5 index * 15: state.listSubcategoryEntity.length));}return _buildSubcategoryWidget(context, index, list);},),),Align(alignment: Alignment.bottomCenter,child: widgetBuilder(id: DemandListPageWidgetId.subcategoryIndicator,builder: () _buildSubcategoryIndicatorWidget(state.listSubcategoryEntity.length 6? 1: ((state.listSubcategoryEntity.length - 5) / 15).ceil() 1,state.index),),)],);至于第一页怎么漏出第二页的数据很简单 把第一页的width宽度设置小一点就能漏出第二页。 为什么是ScreenUtil.width-40你想减多少都可以。。。我只是觉得减40漏出的部分更好看一些。 _buildSubcategoryWidget(BuildContext context, int indexs, ListSubcategoryEntity list) {return SizedBox(width: state.listSubcategoryEntity.length 5indexs0?ScreenUtil.width-40:ScreenUtil.width,child: GridView.builder(key: ValueKey(GridView$id),physics: const NeverScrollableScrollPhysics(),shrinkWrap: true,padding:state.listSubcategoryEntity.length 5indexs0?const EdgeInsets.only(left: 10 , top: 8):const EdgeInsets.only(left: 0, top: 8),gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 5,// crossAxisSpacing: 5,childAspectRatio:1.1,// mainAxisSpacing: 2),itemBuilder: (BuildContext context, int index) {return Ripple(onTap: () {controller.push(url: list[index].jumpUrl ?? );},child: Column(mainAxisSize: MainAxisSize.min,children: [ImageBuild.network(list[index].image?.small ?? ,fit: BoxFit.fill,size: const Size(35, 35),placeholder: AppImage.commonPlaceholderIconSmall),const SizedBox(height: 2.0,),TextBuild.text(list[index].title?.content ?? ,style: AppTextStyleData( fontWeight: AppTextStyle.regular,fontSize: 14,color: AppColorData.hex(list[index].title?.fontColor ?? #1E1E1E),),textAlign: TextAlign.center,),],));},itemCount: indexs 0? (state.listSubcategoryEntity.length 5? state.listSubcategoryEntity.length: 5): (state.listSubcategoryEntity.length 5 indexs * 15? 15: (state.listSubcategoryEntity.length - (5 (indexs - 1) * 15))),),);}主要是监听滑动事件然后动态改变高度 NotificationListenerScrollNotification(onNotification: (ScrollNotification sn) {if (sn.metrics.axis Axis.horizontal) {if (sn is ScrollEndNotification) {// var currentPage (math.max(0.0, clampDouble(sn.metrics.pixels, sn.metrics.minScrollExtent, sn.metrics.maxScrollExtent)) /// math.max(1.0, ScreenUtil.width)).round();// state.index currentPage;// controller.widgetRebuild(DemandListPageWidgetId.subcategoryIndicator);} else {double progress sn.metrics.pixels;if (0 progress progress ScreenUtil.width) {var multiple state.listSubcategoryEntity.length15 ? 1:0;if(state.listSubcategoryEntity.length11){state.height 80;}else{state.height progress/ScreenUtil.width * ((multiple1)*78)80;}} else if (progress 0) {state.height 80;}var currentPage (math.max(0.0, clampDouble(sn.metrics.pixels, sn.metrics.minScrollExtent, sn.metrics.maxScrollExtent)) /math.max(1.0, ScreenUtil.width)).round();state.index currentPage; // 记录当前页数controller.widgetRebuild(DemandListPageWidgetId.subcategory); //刷新页面自行替换}}return false;},child: child );
http://www.dnsts.com.cn/news/40576.html

相关文章:

  • 山西省建设银行网站首页域名申请邮箱
  • 山东专业企业网站建设wordpress的编辑器
  • 网站 数据库 sql 导入上海设计院排名
  • 中国外贸出口网站旅游网站改版方案
  • 网站建设的必要性’网站怎么申请支付宝
  • 深圳做网站哪家公司最好网站推广岗位职责
  • 宜昌营销型网站建设谷歌关键词工具
  • 门户信息类网站建设淘宝店做箱包哪个网站拿货
  • 临沧网站建设c3sales港南网站建设
  • 新闻类网站建设如何找厂家地址
  • 学做土建资料员的网站Git page wordpress
  • 做视频网站资源采集网页效果图设计流程
  • 站长忽略的观点有关网站建设的app
  • php网站开发员工资电脑网
  • 北京移动端网站优化婚恋网站模板下载
  • 用什么软件做动漫视频网站好宁波网站设计
  • 中国空间站叫什么名网络营销型网站建设
  • 洛阳东翔科技做的网站上海华谊集团建设有限公司网站
  • 网站服务器设置建设网站的工具
  • 商城网站建设net2006WordPress_posts
  • 免费空间访客领取网站深圳网站优化包年
  • 有了自己的网站怎么赚钱木模板价格表
  • 太原北京网站建设公司哪个网站可以做卖房
  • 服务类网站怎么做查找网站注册时间
  • 建立网站用英语怎么说叮当设计网
  • 营销型网站建设比较好手机网站菜单设计
  • 浙江手机版建站系统开发在家用电脑做网站
  • 考试系统 微网站是什么样的专业网站制作公司招聘
  • 仙桃网站网站建设外贸平台实训总结
  • 东莞企业建站程序网站建设确认书