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

医药网站怎么做如何推广公众号文章

医药网站怎么做,如何推广公众号文章,百度软件中心下载安装,淘宝店铺网站策划前言Flutter是谷歌的移动UI框架#xff0c;可以快速在iOS和Android上构建高质量的原生用户界面。IT界著名的尼古拉斯高尔包曾说#xff1a;轮子是IT进步的阶梯#xff01;热门的框架千篇一律#xff0c;好用轮子万里挑一#xff01;Flutter作为这两年开始崛起的跨平台开发…前言Flutter是谷歌的移动UI框架可以快速在iOS和Android上构建高质量的原生用户界面。IT界著名的尼古拉斯·高尔包曾说轮子是IT进步的阶梯热门的框架千篇一律好用轮子万里挑一Flutter作为这两年开始崛起的跨平台开发框架其第三方生态相比其他成熟框架还略有不足但轮子的数量也已经很多了。本系列文章挑选日常app开发常用的轮子分享出来给大家提高搬砖效率同时也希望flutter的生态越来越完善轮子越来越多。本系列文章准备了超过50个轮子推荐工作原因尽量每1-2天出一篇文章。tip:本系列文章合适已有部分flutter基础的开发者入门请戳flutter官网正文轮子轮子名称photo_view轮子概述可定制的图片预览查看器:photo_view.轮子作者caraujo.me推荐指数★★★★★常用指数★★★★★效果预览效果图安装dependencies:photo_view: ^0.7.0import package:photo_view/photo_view.dart;使用默认最简单的使用方式overrideWidget build(BuildContext context) {return Container(child: PhotoView(imageProvider: AssetImage(assets/large-image.jpg),));}初步的效果是这样的image可以放大查看但这是一个已经打开预览界面的样子日常使用我们需要从缩略图点击打开预览页面就像上面效果图那样所以我们需要自己写一个单独的预览界面然后从缩略图点击打开。单图片预览单独写一个页面作为图片预览的界面import package:flutter/material.dart;import package:photo_view/photo_view.dart;class PhotoViewSimpleScreen extends StateleeWidget{const PhotoViewSimpleScreen({this.imageProvider,//图片this.loadingChild,//加载时的widgetthis.backgroundDecoration,//背景修饰this.minScale,//最大缩放倍数this.maxScale,//最小缩放倍数this.heroTag,//hero动画tagid});final ImageProvider imageProvider;final Widget loadingChild;final Decoration backgroundDecoration;final dynamic minScale;final dynamic maxScale;final String heroTag;overrideWidget build(BuildContext context) {return Scaffold(body: Container(constraints: BoxConstraints.expand(height: MediaQuery.of(context).size.height,),child: Stack(children: [Positioned(top: 0,left: 0,bottom: 0,right: 0,child: PhotoView(imageProvider: imageProvider,loadingChild: loadingChild,backgroundDecoration: backgroundDecoration,minScale: minScale,maxScale: maxScale,heroAttributes: PhotoViewHeroAttributes(tag: heroTag),enableRotation: true,),),Positioned(//右上角关闭按钮right: 10,top: MediaQuery.of(context).padding.top,child: IconButton(icon: Icon(Icons.close,size: 30,color: Colors.white,),onPressed: (){Navigator.of(context).pop();},),)],),),);}}给你展示缩图的地方加上点击事件打开写好的预览界面onTap: (){Navigator.of(context).push(new FadeRoute(page: PhotoViewSimpleScreen(imageProvider:NetworkImage(img),heroTag: simple,)));},效果如上面gif的第一个效果。多图片预览再单独写一个页面作为多图片预览的界面import package:flutter/material.dart;import package:photo_view/photo_view.dart;import package:photo_view/photo_view_gallery.dart;class PhotoViewGalleryScreen extends StatefulWidget {List images[];int index0;String heroTag;PageController controller;PhotoViewGalleryScreen({Key key,required this.images,this.index,this.controller,this.heroTag}) : super(key: key){controllerPageController(initialPage: index);}override_PhotoViewGalleryScreenState createState() _PhotoViewGalleryScreenState();}class _PhotoViewGalleryScreenState extends State {int currentIndex0;overridevoid initState() {// TODO: implement initStatesuper.initState();currentIndexwidget.index;}overrideWidget build(BuildContext context) {return Scaffold(body: Stack(children: [Positioned(top: 0,left: 0,bottom: 0,right: 0,child: Container(child: PhotoViewGallery.builder(scrollPhysics: const BouncingScrollPhysics(),builder: (BuildContext context, int index) {return PhotoViewGalleryPageOptions(imageProvider: NetworkImage(widget.images[index]),heroAttributes: widget.heroTag.isNotEmpty?PhotoViewHeroAttributes(tag: widget.heroTag):null,);},itemCount: widget.images.length,loadingChild: Container(),backgroundDecoration: null,pageController: widget.controller,enableRotation: true,onPageChanged: (index){setState(() {currentIndexindex;});},)),),Positioned(//图片index显示top: MediaQuery.of(context).padding.top15,width: MediaQuery.of(context).size.width,child: Center(child: Text(${currentIndex1}/${widget.images.length},style: TextStyle(color: Colors.white,fontSize: 16)),),),Positioned(//右上角关闭按钮right: 10,top: MediaQuery.of(context).padding.top,child: IconButton(icon: Icon(Icons.close,size: 30,color: Colors.white,),onPressed: (){Navigator.of(context).pop();},),),],),);}}给你展示缩图的地方加上点击事件打开写好的预览界面onTap: (){//FadeRoute是自定义的切换过度动画(渐隐渐现) 如果不需要 可以使用默认的MaterialPageRouteNavigator.of(context).push(new FadeRoute(page: PhotoViewGalleryScreen(images:imgs,//传入图片listindex: index,//传入当前点击的图片的indexheroTag: img,//传入当前点击的图片的hero tag (可选))));},FadeRoute的源码class FadeRoute extends PageRouteBuilder {final Widget page;FadeRoute({this.page}): super(pageBuilder: (BuildContext context,Animation animation,Animation secondaryAnimation,) page,transitionsBuilder: (BuildContext context,Animation animation,Animation secondaryAnimation,Widget child,) FadeTransition(opacity: animation,child: child,),);}效果如上面gif的第二个效果。从上面的代码可以看出不管是单图还是多图预览预览界面的布局都是完全自己定义的虽然不是拿来即用但是可定制度非常高非常合适改造成自己的项目风格。常用的参数PhotoView(imageProvider: imageProvider, //要显示的图片 AssetImage 或者 NetworkImageloadingChild: loadingChild,//loading时显示的widgetbackgroundDecoration: backgroundDecoration,//背景修饰minScale: minScale,//最大缩放倍数maxScale: maxScale,//最小缩放倍数heroAttributes: PhotoViewHeroAttributes(tag: heroTag),//hero动画tag 不设置或null为不启用hero动画enableRotation: true,//是否允许旋转.....)结尾
http://www.zqtcl.cn/news/911081/

相关文章:

  • 旅游门户网站模板下载全国最新产品代理商
  • 老河口网站设计中企动力科技做什么的
  • 如何建立网站管理系统甘孜州住房和城乡规划建设局网站
  • 阿里网站建设新闻门户网站什么意思
  • 桂林微信网站wordpress 连接信息
  • 电商网站开发简历跨境电商怎么搞
  • php小型网站开发百度知道小程序
  • 风铃网站具体是做那方面的contact form7 v2.1.2 wordpress
  • 临沂网站建设举措网站数据不变重新安装wordpress
  • 外贸网站建设双语网站建设红色大气网络公司企业网站源码_适合广告设计
  • 温州哪里有做网站的阳朔到桂林机场
  • 商务网站建设详细流程小程序商城服务好的商家
  • 苏州建站模板搭建南京地铁最新消息
  • wordpress建网站教程威海建设招聘信息网站
  • 如何制作一网站企业中标信息查询网
  • 百度推广咨询seo搜索引擎优化平台
  • 建设网站要不要投资钱哪里建设网站最好
  • 长沙网站制作公司地址农业推广作业
  • 网站创意设计公司定制网站开发价格
  • 专业网站建设加盟合作怀化seo快速排名
  • 房山区网站建设wordpress自动采集翻译插件怎么用
  • 郴州做网站 郴网互联网站制作公司起名
  • 织梦做的的网站首页显示空白查企业营业执照的网站
  • 葫芦岛公司做网站外贸西班牙语网站建设
  • 广西住房和城乡建设厅培训中心网站首页wordpress建导航
  • 企业建立网站需要提供什么建立网站需要多长钱
  • 科技企业网站源码下载网页设计公司哪家效果好
  • 成都龙泉工程建设有限公司网站网络科技有限公司网站建设策划书
  • 温州网站建设对比赣州招聘网最新招聘
  • 网站建设什么时候好商丘创小资网络有限公司