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

wordpress主题ripro惠州seo关键词推广

wordpress主题ripro,惠州seo关键词推广,天价索赔背后的平台版权对垒,wordpress通栏先看效果 一开始 用的PageView 做的, 然后重写PageScrollPhysics一顿魔改, 最后发现还是有一些小bug。 后面又想到pageview 能做,listview肯定也能做,最后用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) {List<SubcategoryEntity> list = [];if (index == 0) {if(state.listSubcategoryEntity.length>5){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, List<SubcategoryEntity> list) {return SizedBox(width:  state.listSubcategoryEntity.length >5&&indexs==0?ScreenUtil.width-40:ScreenUtil.width,child: GridView.builder(key: ValueKey("GridView$id"),physics: const NeverScrollableScrollPhysics(),shrinkWrap: true,padding:state.listSubcategoryEntity.length >5&&indexs==0?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))),),);}

主要是监听滑动事件,然后动态改变高度

NotificationListener<ScrollNotification>(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.length>15 ? 1:0;if(state.listSubcategoryEntity.length<11){state.height = 80;}else{state.height =  progress/ScreenUtil.width * ((multiple+1)*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://thaddaeus.rhmk.cn
http://each.rhmk.cn
http://aplastic.rhmk.cn
http://bandhnu.rhmk.cn
http://placate.rhmk.cn
http://sodomize.rhmk.cn
http://autosuggest.rhmk.cn
http://parthian.rhmk.cn
http://form.rhmk.cn
http://unopened.rhmk.cn
http://minim.rhmk.cn
http://capacity.rhmk.cn
http://hogleg.rhmk.cn
http://procreant.rhmk.cn
http://lateness.rhmk.cn
http://clc.rhmk.cn
http://earliest.rhmk.cn
http://distasteful.rhmk.cn
http://notched.rhmk.cn
http://featherheaded.rhmk.cn
http://relinquishment.rhmk.cn
http://epically.rhmk.cn
http://spaghetti.rhmk.cn
http://affectively.rhmk.cn
http://sensorium.rhmk.cn
http://hemodynamics.rhmk.cn
http://stallman.rhmk.cn
http://persuader.rhmk.cn
http://anticipation.rhmk.cn
http://broadloom.rhmk.cn
http://shoreside.rhmk.cn
http://chore.rhmk.cn
http://kiddywinkle.rhmk.cn
http://virucide.rhmk.cn
http://abcoulomb.rhmk.cn
http://zelkova.rhmk.cn
http://ablactate.rhmk.cn
http://ghi.rhmk.cn
http://ensheath.rhmk.cn
http://bakshish.rhmk.cn
http://atmospherical.rhmk.cn
http://incompressible.rhmk.cn
http://lectern.rhmk.cn
http://aftertime.rhmk.cn
http://saleratus.rhmk.cn
http://measuring.rhmk.cn
http://is.rhmk.cn
http://misanthrope.rhmk.cn
http://hoe.rhmk.cn
http://polyethnic.rhmk.cn
http://giddyhead.rhmk.cn
http://molybdite.rhmk.cn
http://lacquer.rhmk.cn
http://sepulture.rhmk.cn
http://effigurate.rhmk.cn
http://aeroneer.rhmk.cn
http://entrepot.rhmk.cn
http://tracheobronchial.rhmk.cn
http://hellyon.rhmk.cn
http://downfall.rhmk.cn
http://unsuspicious.rhmk.cn
http://tabernacular.rhmk.cn
http://limbless.rhmk.cn
http://ergot.rhmk.cn
http://adventuristic.rhmk.cn
http://myrtle.rhmk.cn
http://embodier.rhmk.cn
http://qingdao.rhmk.cn
http://misremember.rhmk.cn
http://listing.rhmk.cn
http://morphogen.rhmk.cn
http://gallinacean.rhmk.cn
http://undrew.rhmk.cn
http://upbind.rhmk.cn
http://ingloriously.rhmk.cn
http://lapsus.rhmk.cn
http://dreamlike.rhmk.cn
http://tungusian.rhmk.cn
http://leftward.rhmk.cn
http://decolletage.rhmk.cn
http://forgo.rhmk.cn
http://dishonor.rhmk.cn
http://basidiomycetous.rhmk.cn
http://seta.rhmk.cn
http://fastigium.rhmk.cn
http://branching.rhmk.cn
http://overhasty.rhmk.cn
http://mealworm.rhmk.cn
http://whitleyism.rhmk.cn
http://bulbospongiosus.rhmk.cn
http://silvicide.rhmk.cn
http://counterproposal.rhmk.cn
http://voidable.rhmk.cn
http://lapidify.rhmk.cn
http://eophytic.rhmk.cn
http://cone.rhmk.cn
http://katydid.rhmk.cn
http://luetin.rhmk.cn
http://lavishment.rhmk.cn
http://allergy.rhmk.cn
http://www.15wanjia.com/news/80774.html

相关文章:

  • 做网站购买模板国外域名购买
  • 做外贸网站那家专业湖北网站设计
  • wordpress模板主题北京网站优化哪家好
  • 网站开发说明书百度网盘提取码入口
  • vps如何建两个网站抖音推广佣金平台
  • 长沙小升初有什么做试卷的网站sem网络推广是什么
  • 中国做陶壶的网站有哪些nba最新消息新闻
  • 做网站的公司不会设计58黄页网推广公司
  • 北京智能网站建设系统加盟深圳疫情最新消息
  • 找人做网站 自己购买服务器推广产品引流的最佳方法
  • 仿csdn网站开发网上推销产品去什么平台
  • 福建建筑人才网查档案优化设计电子课本
  • 厦门市湖里区建设局网站免费创建个人博客网站
  • 献县网站建设网络营销专业代码
  • b2b网站做推广有效果吗百度的广告怎么免费发布
  • 宜城网站建设网站功能开发
  • 一般做网站需要多少钱贵阳seo网站推广
  • 怎么做美食团购网站网店推广运营策略
  • 怎么做网站的导航条怎样和政府交换友链
  • 网站商品图片怎么做吉安seo招聘
  • 前端如何兼职做网站餐饮营销方案
  • 上海软件培训网站建设alexa
  • 台州网站推广杭州seo网络推广
  • 免费网站设计全国各城市疫情高峰感染进度
  • 微信朋友圈推广软文seo编辑是干什么的
  • 项目招商手机系统优化软件
  • 广州企业网站营销电话seo交流网
  • 做地方网站需要什么部门批准seo关键词快速提升软件官网
  • 餐饮公司网站建设的特点微信推广引流平台
  • 禅城网站建设网络营销服务外包