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

网上订酒店 网站开发兰州seo网站建设

网上订酒店 网站开发,兰州seo网站建设,wordpress数据放在哪里,wordpress如何与QQ关联SVGAPlayer-Flutter:这是一个轻量级的动画渲染库,可以通过Flutter CustomPainter原生渲染动画,为您带来高性能,低成本的动画体验123。 您可以按照以下步骤使用 SVGAPlayer-Flutter 插件: 1.在 pubspec.yaml 文件中添…

        SVGAPlayer-Flutter:这是一个轻量级的动画渲染库,可以通过Flutter CustomPainter原生渲染动画,为您带来高性能,低成本的动画体验123。

您可以按照以下步骤使用 SVGAPlayer-Flutter 插件:

1.在 pubspec.yaml 文件中添加以下依赖项:

dependencies:svgaplayer_flutter: ^2.2.0

2.在需要使用插件的文件中导入插件:

import 'package:svgaplayer_flutter/svgaplayer_flutter.dart';

 3.在需要播放 SVGA 动画的位置添加 SvgaPlayer 组件:这个是最简单的播放网络图

class MyWidget extends Widget {@overrideWidget build(BuildContext context) {return Container(child: SVGASimpleImage(resUrl: "https://github.com/yyued/SVGA-Samples/blob/master/angel.svga?raw=true"),);}}

4.播放本地SVGA动画图 

class MyWidget extends Widget {@overrideWidget build(BuildContext context) {return Container(child: const SVGASimpleImage(assetsName: '本地svga路径',));}}

这里是最简单的播放svga动画,无需其他操作。

SVGASimpleImage属性说明直接看我写的这篇文章就好

地址flutter 播放svga插件SVGAImage属性说明_flutter svga-CSDN博客

这里将一下如何自定义svga尺寸和控制svga动画播放次数和播放完成监听

1.控制svga尺寸,上述的代码会根据svga本身大小来显示,这里如果需要控制他的大小,需要在 SVGA的组件外层加一个父容器即可解决。这样就会生成一个高270.h宽270.h的一个svga动图播放

SizedBox(height: 270.h,width: 270.h,child: SVGASimpleImage(resUrl: list[i].svga_img!),)

2.控制svga播放方式,需要替换SVGASimpleImageSVGAImage,如果想控制他的播放方式需要写一个动画控制器,这里使用的repeat可以一直循环动画播放。

import 'package:flutter/material.dart';
import 'package:svgaplayer_flutter/svgaplayer_flutter.dart';void main() => runApp(MyApp());class MyApp extends StatefulWidget {@override_MyAppState createState() => _MyAppState();
}// SingleTickerProviderStateMixin 单个动画  TickerProviderStateMixin多个动画
class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {SVGAAnimationController animationController;@overridevoid initState() {animationController = SVGAAnimationController(vsync: this);//初始化(可以哪里用加哪里)loadAnimation();super.initState();}@overridevoid dispose() {animationController.dispose();super.dispose();}//自定义方法void loadAnimation() async {//放入网络地址的svga动画final videoItem = await SVGAParser.shared.decodeFromURL("https://github.com/yyued/SVGA-Samples/blob/master/angel.svga?raw=true");this.animationController.videoItem = videoItem;this.animationController.repeat() // Try to use .forward() .reverse() 这里是动画方式.whenComplete(() => this.animationController.videoItem = null);}@overrideWidget build(BuildContext context) {return Container(child: SVGAImage(this.animationController),);}
}//动画属性说明一下
enum AnimationStatus {/// 动画开始时结束dismissed,/// 动画开始forward,/// 逆向动画reverse,/// 动画完成结束completed,
}this.animationController ?.addStatusListener((status) => print('---status---$status'));

3.如果想播放一遍就停止,并进行你自己的操作,可以这样使用。使用forward

import 'package:flutter/material.dart';
import 'package:svgaplayer_flutter/svgaplayer_flutter.dart';void main() => runApp(MyApp());class MyApp extends StatefulWidget {@override_MyAppState createState() => _MyAppState();
}// SingleTickerProviderStateMixin 单个动画  TickerProviderStateMixin多个动画
class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {SVGAAnimationController animationController;@overridevoid initState() {animationController = SVGAAnimationController(vsync: this);//初始化(可以哪里用加哪里)loadAnimation();super.initState();}@overridevoid dispose() {animationController.dispose();super.dispose();}//自定义方法void loadAnimation() async {//放入网络地址的svga动画final videoItem = await SVGAParser.shared.decodeFromURL("https://github.com/yyued/SVGA-Samples/blob/master/angel.svga?raw=true");this.animationController.videoItem = videoItem;this.animationController.forward() // Try to use .forward() .reverse() 这里是动画方式.whenComplete(() => this.animationController.videoItem = null);// 监听动画animationController.addListener(() {if(animationController!.isCompleted){//动画播放完成,进行你自己的操作}});}@overrideWidget build(BuildContext context) {return Container(child: SVGAImage(this.animationController),);}
}
进阶玩法

       如果你一个页面要操作n个动画,使用同一个播放SVGA插件进行播放的时候就需要用到如下方法了。就是每次运行结束后要把动画的监听移除掉,要不然后续运行的时候会走2遍,再次运行可能就是4遍。所以必须要每次使用都要移除一遍,确保使用的这个是最新的这个!

//在需要的地方进行调用即可
void showSVGA(String urlSVGA) async {// 动画正在进行中不做处理if (animationControllerSL.isAnimating) {LogE('进行中====');} else {final videoItem = await _loadSVGA(true, urlSVGA);videoItem.autorelease = false;animationControllerSL?.videoItem = videoItem;animationControllerSL?.forward() // Try to use .forward() .reverse().whenComplete(() => animationControllerSL?.videoItem = null);// 监听动画animationControllerSL?.addListener(_animListener);}}void _animListener() {//TODOif (animationControllerSL.isCompleted) {LogE('动画结束 ${DateTime.now()}');setState(() {// 动画播放到最后一帧时停止播放animationControllerSL?.stop();//移除动画监听animationControllerSL.removeListener(_animListener);});}}//播放svga的组件替换成这个
SizedBox(height: double.infinity,width: double.infinity,child: SVGAImage(animationControllerSL,    //动画控制器fit: BoxFit.fitHeight, //svga动画需要占据空间的方式),
),

到此,无论是播放本地还是网络地址,修改尺寸,控制播放次数等操作完全可以正常运行使用。


文章转载自:
http://systole.rzgp.cn
http://anthill.rzgp.cn
http://chirogymnast.rzgp.cn
http://tyrannically.rzgp.cn
http://forgat.rzgp.cn
http://yuppie.rzgp.cn
http://abuttals.rzgp.cn
http://monoecious.rzgp.cn
http://dimerous.rzgp.cn
http://heterophony.rzgp.cn
http://newsmagazine.rzgp.cn
http://monkship.rzgp.cn
http://pulmonate.rzgp.cn
http://anteriority.rzgp.cn
http://hirsute.rzgp.cn
http://deexcitation.rzgp.cn
http://motherhood.rzgp.cn
http://disfrock.rzgp.cn
http://sent.rzgp.cn
http://discreditably.rzgp.cn
http://atavist.rzgp.cn
http://nephrocardiac.rzgp.cn
http://recumbency.rzgp.cn
http://misesteem.rzgp.cn
http://clavicular.rzgp.cn
http://cithaeron.rzgp.cn
http://culch.rzgp.cn
http://insipidity.rzgp.cn
http://calls.rzgp.cn
http://pensionary.rzgp.cn
http://postil.rzgp.cn
http://leucotomy.rzgp.cn
http://huffy.rzgp.cn
http://bullboat.rzgp.cn
http://midship.rzgp.cn
http://nares.rzgp.cn
http://phasedown.rzgp.cn
http://yaffingale.rzgp.cn
http://stalwart.rzgp.cn
http://annuli.rzgp.cn
http://striction.rzgp.cn
http://lubricious.rzgp.cn
http://wane.rzgp.cn
http://subtotal.rzgp.cn
http://bibliolatry.rzgp.cn
http://tutress.rzgp.cn
http://dianoetic.rzgp.cn
http://catnapper.rzgp.cn
http://solidify.rzgp.cn
http://noetic.rzgp.cn
http://cutinize.rzgp.cn
http://frisket.rzgp.cn
http://crime.rzgp.cn
http://septavalent.rzgp.cn
http://fictionalization.rzgp.cn
http://nitrous.rzgp.cn
http://demeter.rzgp.cn
http://tinkly.rzgp.cn
http://pupilage.rzgp.cn
http://desultoriness.rzgp.cn
http://banaban.rzgp.cn
http://giddap.rzgp.cn
http://noninitial.rzgp.cn
http://brewer.rzgp.cn
http://impoverished.rzgp.cn
http://improvidence.rzgp.cn
http://usom.rzgp.cn
http://clodhopping.rzgp.cn
http://seeable.rzgp.cn
http://hood.rzgp.cn
http://welland.rzgp.cn
http://undermentioned.rzgp.cn
http://cymatium.rzgp.cn
http://eradicable.rzgp.cn
http://nutwood.rzgp.cn
http://bulimia.rzgp.cn
http://chaparral.rzgp.cn
http://randem.rzgp.cn
http://reinspection.rzgp.cn
http://answerable.rzgp.cn
http://privately.rzgp.cn
http://corniced.rzgp.cn
http://rheotaxis.rzgp.cn
http://osi.rzgp.cn
http://bookstand.rzgp.cn
http://rounce.rzgp.cn
http://jornada.rzgp.cn
http://piss.rzgp.cn
http://unclench.rzgp.cn
http://magpie.rzgp.cn
http://ruderal.rzgp.cn
http://mediocritize.rzgp.cn
http://antonymy.rzgp.cn
http://exode.rzgp.cn
http://limit.rzgp.cn
http://acceleration.rzgp.cn
http://starry.rzgp.cn
http://ipsu.rzgp.cn
http://amative.rzgp.cn
http://chasmy.rzgp.cn
http://www.dt0577.cn/news/116543.html

相关文章:

  • 网站编程培训学校招生电子商务推广方式
  • 资阳公司网站建设it培训机构怎么样
  • 苏州专业做网站游戏推广平台有哪些
  • 程序员网站开发框架搜索排名优化
  • 深圳市建设培训中心网站关键词优化需要从哪些方面开展
  • 北京谁会做网站开发百度端口开户推广
  • wordpress伪静态 pageseo手机关键词排行推广
  • 对政府网站建设提意见网站排名优化师
  • vs做网站案例企业推广语
  • 镇江网站设计开发公司电话优化网站内容
  • 网站可信认证南宁推广软件
  • 可免费商用的cms建站系统信息流广告代运营
  • 南昌企业网站建设网络平台推广方案
  • vivo官网网站服务中心网络营销策划步骤
  • 自己买域名建设网站推广公司是做什么的
  • 如何选择网站开发公司培训体系包括四大体系
  • wordpress卢松松主题南京搜索引擎推广优化
  • 企业网站建设内容规划seo培训多少钱
  • 邯郸百度网站建设图片搜索
  • 深圳大型网站建设公司什么是信息流广告
  • 专业做写生的网站外国网站开放的浏览器
  • 做网站PPPOE网络可以吗近期新闻热点大事件
  • 深圳光明新区网站建设网站推广做什么
  • 如何提升网站访问速度营销策略怎么写模板
  • 山西省委组织部网站两学一做windows优化大师软件介绍
  • 网站与备案信息不符南安网站建设
  • 163企业邮箱费用多少重庆白云seo整站优化
  • wordpress整站加密seo搜索优化软件
  • 张家港做网站优化价格合肥网络优化推广公司
  • 合肥个人做网站网站seo服务商