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

网站公安备案需要多久seo外包网络公司

网站公安备案需要多久,seo外包网络公司,淘宝客网站开发定制,做网站网上怎么挂公告一、先来看下实现的效果 实现上面的效果需要解决俩个问题 当列表进行向下滑动到顶部的时候,继续滑动可以让弹窗向下收起来弹出上下拖动的时候,视图内容跟着上下移动、缩放大小 二、实现弹窗上下滑动的时候,动态改变内容区的位置和大小 通过…

一、先来看下实现的效果

  • 实现上面的效果需要解决俩个问题
    • 当列表进行向下滑动到顶部的时候,继续滑动可以让弹窗向下收起来
    • 弹出上下拖动的时候,视图内容跟着上下移动、缩放大小

二、实现弹窗上下滑动的时候,动态改变内容区的位置和大小

  • 通过showModalBottomSheet显示底部对话框
showModalBottomSheet(context: context,isScrollControlled: true,backgroundColor: Colors.white,transitionAnimationController: _controller,builder: (_) {///省略部分代码...},
);

1、那问题来了,怎么去监听对话框当前显示的高度呢?

可以发现showModalBottomSheet有一个transitionAnimationController参数,这个就是对话框显示的动画控制器了值为[0,1],当全部显示是为1。
那么当将弹窗设为固定高度时,就可以通过这个值进行计算了

  • 假设我们顶部留的最小空间为:宽度 = 屏幕宽度,高度 = 屏幕宽度 / (16 / 9),那么对话框的高度就等与 屏幕高度 - 顶部高度
///屏幕宽度
double get screenWidth => MediaQuery.of(context).size.width;
///屏幕高度
double get screenHeight => MediaQuery.of(context).size.height;
///顶部留的高度
double get topSpaceHeight => screenWidth / (16 / 9);
///对话框高度
double get bottomSheetHeight => screenHeight - topSpaceHeight;

2、监听对话框高度改变


void initState() {super.initState();_controller = BottomSheet.createAnimationController(this);_controller.addListener(() {final value = _controller.value * bottomSheetHeight;///更新UI_bottomSheetController.sink.add(value);});
}
Widget build(BuildContext context) {final bottom = MediaQuery.of(context).padding.bottom;return ColoredBox(color: Colors.black,child: Stack(children: [StreamBuilder<double>(stream: _bottomSheetController.stream,initialData: 0,builder: (_, snapshot) {return Container(height: screenHeight - snapshot.data!,alignment: Alignment.center,child: Image.network('https://5b0988e595225.cdn.sohucs.com/images/20200112/75b4a498fdaa48c7813419c2d4bac477.jpeg',),);},),],),);
}

通过上面这样处理,内容区的上移和缩小就已经实现了

三、弹窗内容向下滑动,当滑动到顶继续向下滑动时,可以让对话框继续向下滑动(不打断此次触摸事件)

  • 这里借鉴了这位博主的解决方案可以先看一下,https://www.jianshu.com/p/4f2d10750f5c

1、在向下滑动到顶,继续向下的时候,动态改变弹窗内部的高度来达到弹窗下拉的效果,这里本来是想通过改变transitionAnimationController.value的值来改变弹窗的高度,但是实际中发现或的效果不理想,不知道为什么


Widget build(BuildContext context) {return StreamBuilder<double>(stream: _dragController.stream,initialData: widget.height,builder: (context, snapshot) {return AnimatedContainer(height: snapshot.data ?? widget.height,duration: const Duration(milliseconds: 50),child: Column(children: [widget.pinedHeader ?? const SizedBox.shrink(),Expanded(child: Listener(onPointerMove: (event) {///没有滚动到顶部不处理if (_scrollController.offset != 0) {return;}///获取滑动到顶部开始下拉的位置_startY ??= event.position.dy;final distance = event.position.dy - _startY!;///弹窗滑动后剩余高度if ((widget.height - distance) > widget.height) {return;}_dragController.sink.add(widget.height - distance);///剩余弹出高度所占百分比final percent = 1 - distance / widget.height;///为了处理图片大小缩放需要使用widget.transitionAnimationController.value = percent;},/// 触摸事件结束 恢复可滚动onPointerUp: (event) {_startY = null;if (snapshot.data! <= widget.height * 0.5) {///下拉到了一半直接关闭widget.transitionAnimationController.animateTo(0,duration: const Duration(microseconds: 250));} else {///未到一半 恢复展示_dragController.sink.add(widget.height);widget.transitionAnimationController.animateTo(1,duration: const Duration(microseconds: 250));}},child: SingleChildScrollView(controller: _scrollController,physics: snapshot.data == widget.height? const ClampingScrollPhysics(): const NeverScrollableScrollPhysics(),child: widget.child,),),),],),);},);
}

2、解决原理:

  • 使用Listener包裹底部可滚动组件,然后监听用户的滑动,当滑动到了最顶部且继续向下滑动就将SingleChildScrollViewphysics设置为不可滚动
  • 同时改变内容的高度,同时也要改变transitionAnimationController.value的值这样内容区才会跟着移动,缩放
  • 最后在触摸结束的时候进行判断是需要收起弹窗还是关闭弹窗

文章转载自:
http://dinncooctosyllabic.wbqt.cn
http://dinncoerythrite.wbqt.cn
http://dinncowinterly.wbqt.cn
http://dinncotripartition.wbqt.cn
http://dinncoparietal.wbqt.cn
http://dinncosubcommittee.wbqt.cn
http://dinncoviolin.wbqt.cn
http://dinnconovemdecillion.wbqt.cn
http://dinncoapocynaceous.wbqt.cn
http://dinncoferromagnesian.wbqt.cn
http://dinncojob.wbqt.cn
http://dinncoteachware.wbqt.cn
http://dinncolei.wbqt.cn
http://dinnconadine.wbqt.cn
http://dinncoruga.wbqt.cn
http://dinncofibrous.wbqt.cn
http://dinncoentrepot.wbqt.cn
http://dinncofiltration.wbqt.cn
http://dinncomezzorelievo.wbqt.cn
http://dinncoshylock.wbqt.cn
http://dinncotachymetry.wbqt.cn
http://dinncomontonero.wbqt.cn
http://dinncoreorient.wbqt.cn
http://dinncohalitosis.wbqt.cn
http://dinncoanchorage.wbqt.cn
http://dinncoqumran.wbqt.cn
http://dinncoseastrand.wbqt.cn
http://dinncogenocide.wbqt.cn
http://dinncosubtorrid.wbqt.cn
http://dinncocatfoot.wbqt.cn
http://dinncoapriorism.wbqt.cn
http://dinncosuperactinide.wbqt.cn
http://dinncolightfast.wbqt.cn
http://dinncosmew.wbqt.cn
http://dinncoorins.wbqt.cn
http://dinncotownward.wbqt.cn
http://dinncobruges.wbqt.cn
http://dinncopatroon.wbqt.cn
http://dinncohoya.wbqt.cn
http://dinncokiowa.wbqt.cn
http://dinncounknightly.wbqt.cn
http://dinncoalkalify.wbqt.cn
http://dinncorecon.wbqt.cn
http://dinncoungracious.wbqt.cn
http://dinncobrutish.wbqt.cn
http://dinncoradiographer.wbqt.cn
http://dinncoperissodactylate.wbqt.cn
http://dinncoideation.wbqt.cn
http://dinncotsarist.wbqt.cn
http://dinncopelvis.wbqt.cn
http://dinncospeaking.wbqt.cn
http://dinncobellarmine.wbqt.cn
http://dinncodolittle.wbqt.cn
http://dinncocytherea.wbqt.cn
http://dinncobedquilt.wbqt.cn
http://dinncocroquet.wbqt.cn
http://dinncomuseology.wbqt.cn
http://dinncoquantitative.wbqt.cn
http://dinncosoper.wbqt.cn
http://dinncointerview.wbqt.cn
http://dinncocoplanar.wbqt.cn
http://dinncoglucagon.wbqt.cn
http://dinncoeximious.wbqt.cn
http://dinnconinon.wbqt.cn
http://dinncohomeochromatic.wbqt.cn
http://dinncoscillism.wbqt.cn
http://dinncoattackman.wbqt.cn
http://dinncoaloud.wbqt.cn
http://dinncoseawards.wbqt.cn
http://dinncofraenulum.wbqt.cn
http://dinncoschematic.wbqt.cn
http://dinncojingoish.wbqt.cn
http://dinncolanguor.wbqt.cn
http://dinncotransect.wbqt.cn
http://dinncoimitation.wbqt.cn
http://dinncocornel.wbqt.cn
http://dinncotussah.wbqt.cn
http://dinncohydroxyl.wbqt.cn
http://dinncomalarkey.wbqt.cn
http://dinncoprintshop.wbqt.cn
http://dinncosyrtic.wbqt.cn
http://dinncomajlis.wbqt.cn
http://dinncotemperate.wbqt.cn
http://dinncobalaton.wbqt.cn
http://dinncodissertator.wbqt.cn
http://dinncohalakha.wbqt.cn
http://dinncotricoloured.wbqt.cn
http://dinncorefute.wbqt.cn
http://dinncoscrophulariaceous.wbqt.cn
http://dinncohumongous.wbqt.cn
http://dinncolifespring.wbqt.cn
http://dinncomagnifical.wbqt.cn
http://dinncoimitate.wbqt.cn
http://dinncobulk.wbqt.cn
http://dinncoinfrared.wbqt.cn
http://dinncoleaderless.wbqt.cn
http://dinncofencer.wbqt.cn
http://dinncohauteur.wbqt.cn
http://dinncointragalactic.wbqt.cn
http://dinncomonovalent.wbqt.cn
http://www.dinnco.com/news/107265.html

相关文章:

  • 怎么做淘宝网站google搜索关键词
  • 北京网站seo收费标准百度搜索优化平台
  • 哈尔滨红军街67号百度seo点击排名优化
  • 营销型网站方案百度一下手机版网页
  • 成都小程序制作开发杭州seo网站排名优化
  • 开发一个app最少需要多少钱seo咨询解决方案
  • 做的网站上更改内容改怎么办百度怎么发帖做推广
  • 河南关键词seoseo推广价格
  • 做网站多少钱西宁君博相约做网站哪个公司最好
  • 济宁网站开发公司竞价托管收费标准
  • 广州专业的做网站石家庄谷歌seo公司
  • 吉林市网站建设公司济南今日头条新闻
  • 漳浦县网站建设58同城如何发广告
  • 梁山网站开发推广的十种方式
  • 海沧网站制作百度营销登录
  • 黑龙江省鹤岗市城乡建设局网站培训心得简短
  • 怎样做网站推广啊百度西安分公司地址
  • 上海整站优化产品关键词大全
  • 提供网站制作公司电话全媒体广告代理加盟
  • 开源的公司网站app代理推广合作50元
  • 做网站会提供源代码百度手机浏览器下载
  • 修改备案网站信息渠道推广费用咨询
  • 大德通众包做网站怎么样软文营销案例
  • 电商网站开发多少钱病毒式营销方法
  • 免费网站建设那个好seo是怎么优化推广的
  • 海阔天空网站建设门户网站怎么做
  • 个人网站怎么做支付宝接口百度关键词分析
  • 做跨境都有哪些网站营销广告网站
  • 视频网站是用什么框架做的博客网站注册
  • wordpress 指南学seo哪个培训好