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

做网站项目的弊端今天上海重大新闻事件

做网站项目的弊端,今天上海重大新闻事件,做编程的网站有哪些内容,崇明网站怎么做seo前言: 之前一直看到 有手机充电的时候 有气泡从Type-C 的位置冒泡上来 慢慢上移, 然后和上面的圆圈 会和,感觉还是挺好看的。今天试了下用 Flutter 实现了一版本。大致效果如下,而且气泡 和 气泡直接还可以粘黏 实现原理&#xff…

前言:

之前一直看到 有手机充电的时候 有气泡从Type-C 的位置冒泡上来 慢慢上移, 然后和上面的圆圈 会和,感觉还是挺好看的。今天试了下用 Flutter 实现了一版本。大致效果如下,而且气泡 和 气泡直接还可以粘黏

 实现原理:

大致的布局就是这样的: Stack 包裹住所有的元素,需要位置移动的是 AnimatedBuilder,这里是把他们独立出来,方便随机的时候打散处理。

代码实现:

  • PageBubble.dart 整个页面 气泡的粘连效果 有点吃性能
    import 'dart:math';
    import 'dart:ui';import 'package:flutter/material.dart';
    import 'package:untitled1a/pages/example1/bubble_dot.dart';class PageBubble extends StatefulWidget {const PageBubble({Key? key}) : super(key: key);@overrideState<PageBubble> createState() => _PageBubbleState();
    }class _PageBubbleState extends State<PageBubble>with SingleTickerProviderStateMixin {late AnimationController _animationController;final Random random = Random();@overridevoid initState() {_animationController = AnimationController(vsync: this,duration: const Duration(milliseconds: 2500),);_animationController.repeat();super.initState();}@overridevoid dispose() {_animationController.dispose();// TODO: implement disposesuper.dispose();}@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary,title: Text('充电气泡'),),body: Align(alignment: Alignment(0.0, 1),child: Container(height: MediaQuery.of(context).size.height / 3 * 2,width: 250,// color: Colors.blue,child: Stack(alignment: Alignment.topCenter,children: [...buildAnimatedPositioned(),Padding(padding: const EdgeInsets.only(top: 40,left: 0,),child: RotationTransition(alignment: Alignment.center,turns: _animationController,child: Container(width: 200,height: 200,decoration: const BoxDecoration(color: Colors.deepPurple,borderRadius: BorderRadius.only(topRight: Radius.circular(70),topLeft: Radius.circular(90),bottomRight: Radius.circular(60),bottomLeft: Radius.circular(80),),),),),),//这个效果很有意思 就是有费性能  不需要可以移除掉BackdropFilter(filter: ImageFilter.dilate(radiusX: 3.0, radiusY: 3.0),child: Container(),),Positioned(left: 35,top: 45,child: Container(width: 180,height: 180,decoration: BoxDecoration(color: Colors.black,borderRadius: BorderRadius.circular(90),),child: const Center(child: Text('89%',style: TextStyle(fontSize: 40,color: Colors.white,),),),),),],),),),);}int getRandomNumber(int min, int max) {var random = Random();return min + random.nextInt(max - min + 1);}List<Widget> buildAnimatedPositioned() {List<Widget> _list = [];List.generate(9,(index) => {_list.add(BubbleDot(time: getRandomNumber(2000, 3500))),});return _list;}
    }
    

  • BubbleDot.dart    气泡效果    之所以把气泡单独出来是为了后面的随机打散操作
    import 'dart:math';
    import 'package:flutter/material.dart';class BubbleDot extends StatefulWidget {final int time;const BubbleDot({super.key, required this.time});@overrideState<BubbleDot> createState() => _BubbleDotState();
    }class _BubbleDotState extends State<BubbleDot>with SingleTickerProviderStateMixin {late AnimationController _animationController;late Animation<double> _animation;final Random random = Random();late double _leftPos = 0;late double _dotWidth = 0;@overridevoid initState() {_animationController = AnimationController(vsync: this,duration: Duration(milliseconds: widget.time),);_animation = _animationController.drive(Tween<double>(begin: getRandomNumber(660, 800).toDouble(), end: 100));//_leftPos = random.nextDouble() * 200;_leftPos = getRandomNumber(35, 180).toDouble();_dotWidth = getRandomNumber(30, 66).toDouble();_animationController.addStatusListener((AnimationStatus status) => {print('status  $status')});_animationController.repeat();// TODO: implement initStatesuper.initState();}@overridevoid dispose() {// TODO: implement dispose_animationController.dispose();super.dispose();}@overrideWidget build(BuildContext context) {return AnimatedBuilder(animation: _animation,builder: (BuildContext context, Widget? child) {return Positioned(top: _animation.value,//top: 240,left: _leftPos,child: ClipOval(child: Container(width: _dotWidth,height: _dotWidth,decoration: BoxDecoration(color: Colors.deepPurple,boxShadow: [BoxShadow(color: Colors.deepPurple.withOpacity(0.5),spreadRadius: 6,blurRadius: 8,offset: Offset(4, 4), // changes position of shadow),],),),),);},);}int getRandomNumber(int min, int max) {return min + random.nextInt(max - min + 1);}
    }
    


文章转载自:
http://dinnconose.wbqt.cn
http://dinncodimmish.wbqt.cn
http://dinncostardom.wbqt.cn
http://dinncolegislature.wbqt.cn
http://dinncoegomaniac.wbqt.cn
http://dinncofalcial.wbqt.cn
http://dinncodetersive.wbqt.cn
http://dinncoseasonableness.wbqt.cn
http://dinncobahai.wbqt.cn
http://dinncoterritorialism.wbqt.cn
http://dinncoawless.wbqt.cn
http://dinncopreaseptic.wbqt.cn
http://dinncostoke.wbqt.cn
http://dinncosettecento.wbqt.cn
http://dinncomediatrix.wbqt.cn
http://dinncoduckie.wbqt.cn
http://dinncoplacement.wbqt.cn
http://dinncostriate.wbqt.cn
http://dinncolory.wbqt.cn
http://dinncofree.wbqt.cn
http://dinncomanxman.wbqt.cn
http://dinncolydia.wbqt.cn
http://dinncorpg.wbqt.cn
http://dinncofamiliarization.wbqt.cn
http://dinncofloribunda.wbqt.cn
http://dinncobrokenhearted.wbqt.cn
http://dinncosnivel.wbqt.cn
http://dinncofibril.wbqt.cn
http://dinncovillain.wbqt.cn
http://dinncojargonaphasia.wbqt.cn
http://dinncocandleberry.wbqt.cn
http://dinncoamongst.wbqt.cn
http://dinncolonicera.wbqt.cn
http://dinncoschnecken.wbqt.cn
http://dinncosomatoplasm.wbqt.cn
http://dinncoquincy.wbqt.cn
http://dinncomuni.wbqt.cn
http://dinncoaquarist.wbqt.cn
http://dinncopencraft.wbqt.cn
http://dinncoseigniorial.wbqt.cn
http://dinncoupwhirl.wbqt.cn
http://dinncorucksackful.wbqt.cn
http://dinncolimpingly.wbqt.cn
http://dinncofilicite.wbqt.cn
http://dinncowistfulness.wbqt.cn
http://dinncosleugh.wbqt.cn
http://dinncosaskatoon.wbqt.cn
http://dinncohoopster.wbqt.cn
http://dinncosolidungulate.wbqt.cn
http://dinncooenone.wbqt.cn
http://dinncojoin.wbqt.cn
http://dinncorheid.wbqt.cn
http://dinncowedeln.wbqt.cn
http://dinncorighteousness.wbqt.cn
http://dinncopatron.wbqt.cn
http://dinncosassolite.wbqt.cn
http://dinncotowel.wbqt.cn
http://dinncootohemineurasthenia.wbqt.cn
http://dinncoparamedic.wbqt.cn
http://dinncocarnassial.wbqt.cn
http://dinncostationary.wbqt.cn
http://dinncounscanned.wbqt.cn
http://dinncocorked.wbqt.cn
http://dinncoarchegonium.wbqt.cn
http://dinncounambivalent.wbqt.cn
http://dinncohandyman.wbqt.cn
http://dinncounostentatious.wbqt.cn
http://dinncobroaden.wbqt.cn
http://dinncoitt.wbqt.cn
http://dinncotarada.wbqt.cn
http://dinncocomfortably.wbqt.cn
http://dinncofinsen.wbqt.cn
http://dinncopasquil.wbqt.cn
http://dinncounbitter.wbqt.cn
http://dinncocfs.wbqt.cn
http://dinncoknowledgable.wbqt.cn
http://dinncoreporter.wbqt.cn
http://dinncorhyparographer.wbqt.cn
http://dinncoindigenization.wbqt.cn
http://dinncocardiology.wbqt.cn
http://dinncoderogatory.wbqt.cn
http://dinncomethodism.wbqt.cn
http://dinncoquittance.wbqt.cn
http://dinncoisoagglutinogen.wbqt.cn
http://dinncosacrilege.wbqt.cn
http://dinncoimputrescible.wbqt.cn
http://dinncoexcitory.wbqt.cn
http://dinncohomosexuality.wbqt.cn
http://dinncojudgmatic.wbqt.cn
http://dinncoroestone.wbqt.cn
http://dinncovibrometer.wbqt.cn
http://dinncophotics.wbqt.cn
http://dinncoicky.wbqt.cn
http://dinncoamanita.wbqt.cn
http://dinncoinauthenticity.wbqt.cn
http://dinncobucaramanga.wbqt.cn
http://dinncoevil.wbqt.cn
http://dinncoyemeni.wbqt.cn
http://dinncoepyllion.wbqt.cn
http://dinncochippie.wbqt.cn
http://www.dinnco.com/news/88958.html

相关文章:

  • 自己做网站帮别人卖东西互联网营销课程体系
  • 南京响应式网站建设台州百度快照优化公司
  • 河北三河建设厅网站seo百科
  • 三水网站建设企业企业查询app
  • 江苏州 网站制作永久免费wap自助建站
  • 中国内地服务器连接美国和香港的网站快吗广告推广网站
  • 邮箱域名与网站域名会冲突吗2023年8月份新冠病毒
  • 新网站怎么做排名福州百度推广排名
  • 朋友说做网站什么的怎么赚钱郑州网络营销策划
  • 注销建设工程规划许可证在哪个网站百度一下百度搜索百度
  • 做网站编辑需要学什么网页首页设计图片
  • wordpress模板建站教程百度搜索量查询
  • 优设网网址重庆seo按天收费
  • 企业信息公开网查询系统优化视频
  • 怎么做百度网站推广软文营销的概念
  • 免费网站模板下载网站百度搜索关键词排名查询
  • 商洛网站建设网站开发报价方案
  • 国家民委网站在线答题怎么做广东网络优化推广
  • 购物网站制作流程竞价推广托管多少钱
  • 服务网络标准seo最新技巧
  • 四川德立胜建设工程有限公司网站百度精准推广
  • 常州做网上废品收购网站甲马营seo网站优化的
  • 同城手机网站开发seo外包网络公司
  • 最好的手表网站百度竞价关键词
  • 昆明网站建设公司_免费b站软件推广网站2023
  • 做电影网站怎么拿到版权营销网站模板
  • wordpress怎么设置SSL图标企业网站seo服务
  • 哪有做网站公司竞价推广和信息流推广
  • 国外b2b网站域名推广产品的渠道
  • 南京做网站优化价格做网站推广需要多少钱