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

外贸网站中的搜索产品功能如何实现谷歌优化

外贸网站中的搜索产品功能如何实现,谷歌优化,自己做网站挣钱吗,室内设计联盟邀请码package:simple_animations 导入包到项目中去 可以实现简单的动画, 快速实现,不需要自己过多的设置 有多种样式可以实现[ ] 功能: 简单的用例:具体需要详细可以去 pub 链接地址 1. PlayAnimationBuilder PlayAnima…

在这里插入图片描述

package:simple_animations

导入包到项目中去

  • 可以实现简单的动画,
  • 快速实现,不需要自己过多的设置
  • 有多种样式可以实现
  • [ ]

功能:

简单的用例:具体需要详细可以去 pub 链接地址

1. PlayAnimationBuilder

PlayAnimationBuilder<double>(tween: Tween(begin: 100.0, end: 200.0), //数值是100 到00duration: const Duration(seconds: 1), // 动画的时间,是1s 完成动画builder: (context, value, _) {return Container(width: value, // 使用tween 的数值height: value,color: Colors.blue,);},onCompleted: () {// 结束的时候做什么操作},onStarted: (){//在开始的时候运行什么,做什么操作},)

新增child 参数,静态的child ,减少资源的浪费,其他的build 同样可以这样使用

PlayAnimationBuilder<double>(tween: Tween(begin: 50.0, end: 200.0),duration: const Duration(seconds: 5),child: const Center(child: Text('Hello!')), // pass in static childbuilder: (context, value, child) {return Container(width: value,height: value,color: Colors.green,child: child, // use child inside the animation);},)

2.LoopAnimationBuilder 循环动画

该用例,是一个正方形旋转360度,并且持续的转动

Center(child: LoopAnimationBuilder<double>(tween: Tween(begin: 0.0, end: 2 * pi), // 0° to 360° (2π)duration: const Duration(seconds: 2), // for 2 seconds per iterationbuilder: (context, value, _) {return Transform.rotate(angle: value, // use valuechild: Container(color: Colors.blue, width: 100, height: 100),);},),)

3.MirrorAnimationBuilder 镜像动画

        MirrorAnimationBuilder<double>(tween:Tween(begin: -100.0, end: 100.0), // x 轴的数值duration: const Duration(seconds: 2),//动画时间curve: Curves.easeInOutSine, // 动画曲线builder: (context, value, child) {return Transform.translate(offset: Offset(value, 0), // use animated value for x-coordinatechild: child,);},child: Container(width: 100,height: 100,color: Colors.green,),)

4.CustomAnimationBuilder 自定义动画,可以在stl 无状态里面使用

        CustomAnimationBuilder<double>(control: Control.mirror,tween: Tween(begin: 100.0, end: 200.0),duration: const Duration(seconds: 2),delay: const Duration(seconds: 1),//延迟1s才开始动画curve: Curves.easeInOut,startPosition: 0.5,animationStatusListener: (status) {//状态的监听,可以在这边做一些操作debugPrint('status updated: $status');},builder: (context, value, child) {return Container(width: value,height: value,color: Colors.blue,child: child,);},child: const Center(child: Text('Hello!',style: TextStyle(color: Colors.white, fontSize: 24))),)

带控制器

        CustomAnimationBuilder<double>(duration: const Duration(seconds: 1),control: control, // bind state variable to parametertween: Tween(begin: -100.0, end: 100.0),builder: (context, value, child) {return Transform.translate(// animation that moves childs from left to rightoffset: Offset(value, 0),child: child,);},child: MaterialButton(// there is a buttoncolor: Colors.yellow,onPressed: () {setState(() {control = (control == Control.play)? Control.playReverse: Control.play;});}, // clicking button changes animation directionchild: const Text('Swap'),),)

5.MovieTween 补间动画,可并行的动画

可以一个widget 多个动画同时或者不同时的运行

final MovieTween tween = MovieTween()..scene(begin: const Duration(milliseconds: 0),end: const Duration(milliseconds: 1000)).tween('width', Tween(begin: 0.0, end: 100.0)) //0-1秒的的 width 的数值..scene(begin: const Duration(milliseconds: 1000),end: const Duration(milliseconds: 1500)).tween('width', Tween(begin: 100.0, end: 200.0)) //1-1。5秒的的 width 的数值..scene(begin: const Duration(milliseconds: 0),duration: const Duration(milliseconds: 2500)).tween('height', Tween(begin: 0.0, end: 200.0)) //0-2.5秒的的 height 的数值..scene(begin: const Duration(milliseconds: 0),duration: const Duration(milliseconds: 3000)) //0-3 秒的的 颜色 的数值.tween('color', ColorTween(begin: Colors.red, end: Colors.blue));PlayAnimationBuilder<Movie>(tween: tween, // Pass in tweenduration: tween.duration, // Obtain durationbuilder: (context, value, child) {return Container(width: value.get('width'), // Get animated valuesheight: value.get('height'),color: value.get('color'),);},),

6.MovieTween 串行的动画补间

简单的意思就是,按照设计的动画一个一个执行,按照顺序来执行,可以设置不同的数值或者是参数来获取,然后改变动画

final signaltween = MovieTween()..tween('x', Tween(begin: -100.0, end: 100.0),duration: const Duration(seconds: 1)).thenTween('y', Tween(begin: -100.0, end: 100.0),duration: const Duration(seconds: 1)).thenTween('x', Tween(begin: 100.0, end: -100.0),duration: const Duration(seconds: 1)).thenTween('y', Tween(begin: 100.0, end: -100.0),duration: const Duration(seconds: 1));LoopAnimationBuilder<Movie>(tween: signaltween,builder: (ctx, value, chid) {return Transform.translate(offset: Offset(value.get('x'), value.get('y')),child: Container(width: 100,height: 100,color: Colors.green,));},duration: signaltween.duration,
),

总的代码:

import 'dart:math';import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';void main() {runApp(const MaterialApp(home: Scaffold(body: MyPage())));
}class MyPage extends StatefulWidget {const MyPage({Key? key}) : super(key: key);State<MyPage> createState() => _MyPageState();
}class _MyPageState extends State<MyPage> {Control control = Control.play; // state variablevoid toggleDirection() {// toggle between control instructionssetState(() {control = (control == Control.play) ? Control.playReverse : Control.play;});}Widget build(BuildContext context) {
//电影样式的动画final MovieTween tween = MovieTween()..scene(begin: const Duration(milliseconds: 0),end: const Duration(milliseconds: 1000)).tween('width', Tween(begin: 0.0, end: 100.0)) //0-1秒的的 width 的数值..scene(begin: const Duration(milliseconds: 1000),end: const Duration(milliseconds: 1500)).tween('width', Tween(begin: 100.0, end: 200.0)) //1-1。5秒的的 width 的数值..scene(begin: const Duration(milliseconds: 0),duration: const Duration(milliseconds: 2500)).tween('height', Tween(begin: 0.0, end: 200.0)) //0-2.5秒的的 height 的数值..scene(begin: const Duration(milliseconds: 0),duration: const Duration(milliseconds: 3000)) //0-3 秒的的 颜色 的数值.tween('color', ColorTween(begin: Colors.red, end: Colors.blue));final signaltween = MovieTween()..tween('x', Tween(begin: -100.0, end: 100.0),duration: const Duration(seconds: 1)).thenTween('y', Tween(begin: -100.0, end: 100.0),duration: const Duration(seconds: 1)).thenTween('x', Tween(begin: 100.0, end: -100.0),duration: const Duration(seconds: 1)).thenTween('y', Tween(begin: 100.0, end: -100.0),duration: const Duration(seconds: 1));return SingleChildScrollView(child: Column(children: [LoopAnimationBuilder<Movie>(tween: signaltween,builder: (ctx, value, chid) {return Transform.translate(offset: Offset(value.get('x'), value.get('y')),child: Container(width: 100,height: 100,color: Colors.green,));},duration: signaltween.duration,),PlayAnimationBuilder<Movie>(tween: tween, // Pass in tweenduration: tween.duration, // Obtain durationbuilder: (context, value, child) {return Container(width: value.get('width'), // Get animated valuesheight: value.get('height'),color: value.get('color'),);},),PlayAnimationBuilder<double>(tween: Tween(begin: 100.0, end: 200.0), //数值是100 到00duration: const Duration(seconds: 1), // 动画的时间,是1s 完成动画builder: (context, value, _) {return Container(width: value, // 使用tween 的数值height: value,color: Colors.blue,);},onCompleted: () {// 结束的时候做什么操作},onStarted: () {//在开始的时候运行什么,做什么操作},),MirrorAnimationBuilder<Color?>(tween:ColorTween(begin: Colors.red, end: Colors.blue), // 颜色的渐变 红色到蓝色duration: const Duration(seconds: 5), // 动画时长5秒builder: (context, value, _) {return Container(color: value, // 使用该数值width: 100,height: 100,);},),//实现一个绿色箱子从左到右,从右到走MirrorAnimationBuilder<double>(tween: Tween(begin: -100.0, end: 100.0), // x 轴的数值duration: const Duration(seconds: 2), //动画时间curve: Curves.easeInOutSine, // 动画曲线builder: (context, value, child) {return Transform.translate(offset: Offset(value, 0), // use animated value for x-coordinatechild: child,);},child: Container(width: 100,height: 100,color: Colors.green,),),CustomAnimationBuilder<double>(control: Control.mirror,tween: Tween(begin: 100.0, end: 200.0),duration: const Duration(seconds: 2),delay: const Duration(seconds: 1),curve: Curves.easeInOut,startPosition: 0.5,animationStatusListener: (status) {debugPrint('status updated: $status');},builder: (context, value, child) {return Container(width: value,height: value,color: Colors.blue,child: child,);},child: const Center(child: Text('Hello!',style: TextStyle(color: Colors.white, fontSize: 24))),),CustomAnimationBuilder<double>(duration: const Duration(seconds: 1),control: control, // bind state variable to parametertween: Tween(begin: -100.0, end: 100.0),builder: (context, value, child) {return Transform.translate(// animation that moves childs from left to rightoffset: Offset(value, 0),child: child,);},child: MaterialButton(// there is a buttoncolor: Colors.yellow,onPressed: () {setState(() {control = (control == Control.play)? Control.playReverse: Control.play;});}, // clicking button changes animation directionchild: const Text('Swap'),),)],),);}
}

混合多种动画

import 'dart:math';import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';void main() {runApp(const MaterialApp(home: Scaffold(body: MyPage())));
}class MyPage extends StatefulWidget {const MyPage({Key? key}) : super(key: key);State<MyPage> createState() => _MyPageState();
}class _MyPageState extends State<MyPage> {Control control = Control.play; // state variableWidget build(BuildContext context) {final x = MovieTweenProperty<double>();final y = MovieTweenProperty<double>();final color = MovieTweenProperty<Color>();final tween = MovieTween()..scene(begin: const Duration(seconds: 0),duration: const Duration(seconds: 1)).tween(x, Tween(begin: -100.0, end: 100.0),curve: Curves.easeInOutSine).tween(color, ColorTween(begin: Colors.red, end: Colors.yellow))..scene(begin: const Duration(seconds: 1),duration: const Duration(seconds: 1)).tween(y, Tween(begin: -100.0, end: 100.0),curve: Curves.easeInOutSine)..scene(begin: const Duration(seconds: 2),duration: const Duration(seconds: 1)).tween(x, Tween(begin: 100.0, end: -100.0),curve: Curves.easeInOutSine)..scene(begin: const Duration(seconds: 1),end: const Duration(seconds: 3)).tween(color, ColorTween(begin: Colors.yellow, end: Colors.blue))..scene(begin: const Duration(seconds: 3),duration: const Duration(seconds: 1)).tween(y, Tween(begin: 100.0, end: -100.0),curve: Curves.easeInOutSine).tween(color, ColorTween(begin: Colors.blue, end: Colors.red));return MaterialApp(home: Scaffold(backgroundColor: Colors.white,body: Center(child: LoopAnimationBuilder<Movie>(tween: tween, // Pass in tweenduration: tween.duration, // Obtain durationbuilder: (context, value, child) {return Transform.translate(// Get animated offsetoffset: Offset(x.from(value), y.from(value)),child: Container(width: 100,height: 100,color: color.from(value), // Get animated color),);},),),),);}
}

边运动便改变颜色

同原生的动画混合开发

以下代码实现,一个container 的宽高的尺寸变化

class MyPage extends StatefulWidget {const MyPage({Key? key}) : super(key: key);State<MyPage> createState() => _MyPageState();
}class _MyPageState extends State<MyPage> with AnimationMixin {//同原生的混合使用// Control control = Control.play; // state variablelate Animation<double> size;void initState() {super.initState();// controller 不需要重新定义,AnimationMixin 里面已经自动定义了个size = Tween(begin: 0.0, end: 200.0).animate(controller);controller.play(); //运行}Widget build(BuildContext context) {return MaterialApp(home: Scaffold(backgroundColor: Colors.white,body: Center(child: Container(width: size.value,height: size.value,color: Colors.red,),),),);}
}

实现图

多个控制器控制一个widget的实现多维度的动画实现

import 'dart:math';import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';void main() {runApp(const MaterialApp(home: Scaffold(body: MyPage())));
}class MyPage extends StatefulWidget {const MyPage({Key? key}) : super(key: key);State<MyPage> createState() => _MyPageState();
}class _MyPageState extends State<MyPage> with AnimationMixin {//同原生的混合使用late AnimationController widthcontrol; //宽度控制late AnimationController heigthcontrol; //高度控制器late AnimationController colorcontrol; //颜色控制器late Animation<double> width; //宽度控制late Animation<double> heigth; //高度控制late Animation<Color?> color; //颜色控制void initState() {
// mirror 镜像widthcontrol = createController()..mirror(duration: const Duration(seconds: 5));heigthcontrol = createController()..mirror(duration: const Duration(seconds: 3));colorcontrol = createController()..mirror(duration: const Duration(milliseconds: 1500));width = Tween(begin: 100.0, end: 200.0).animate(widthcontrol);heigth = Tween(begin: 100.0, end: 200.0).animate(heigthcontrol);color = ColorTween(begin: Colors.green, end: Colors.black).animate(colorcontrol);super.initState();}Widget build(BuildContext context) {return MaterialApp(home: Scaffold(backgroundColor: Colors.white,body: Center(child: Container(width: width.value,height: heigth.value,color: color.value,),),),);}
}

在这里插入图片描述


文章转载自:
http://dinncopruriently.tpps.cn
http://dinncophyllary.tpps.cn
http://dinncodesirous.tpps.cn
http://dinncoziram.tpps.cn
http://dinncodobe.tpps.cn
http://dinncofeatherwitted.tpps.cn
http://dinncolicit.tpps.cn
http://dinncoprotuberate.tpps.cn
http://dinncounredeemed.tpps.cn
http://dinncospectroscopic.tpps.cn
http://dinncobrawler.tpps.cn
http://dinncopertussis.tpps.cn
http://dinncoauthoress.tpps.cn
http://dinncogarlandage.tpps.cn
http://dinncocounterpull.tpps.cn
http://dinncoanimalization.tpps.cn
http://dinncocongealment.tpps.cn
http://dinncohatter.tpps.cn
http://dinncopresiding.tpps.cn
http://dinncompeg.tpps.cn
http://dinncocomplicacy.tpps.cn
http://dinncopharmacodynamic.tpps.cn
http://dinncoorthotics.tpps.cn
http://dinncopyramid.tpps.cn
http://dinncodualpurpose.tpps.cn
http://dinncobum.tpps.cn
http://dinncoorwellism.tpps.cn
http://dinncopursy.tpps.cn
http://dinncogullible.tpps.cn
http://dinncothey.tpps.cn
http://dinncotowerman.tpps.cn
http://dinncovulcanise.tpps.cn
http://dinncocacorhythmic.tpps.cn
http://dinncodecane.tpps.cn
http://dinncowhole.tpps.cn
http://dinncotallith.tpps.cn
http://dinncoorchid.tpps.cn
http://dinncoflyblow.tpps.cn
http://dinncoglosseme.tpps.cn
http://dinncocoranto.tpps.cn
http://dinncotwinight.tpps.cn
http://dinncodownspout.tpps.cn
http://dinncogetup.tpps.cn
http://dinncoadumbral.tpps.cn
http://dinncoischial.tpps.cn
http://dinncoabcd.tpps.cn
http://dinncozhejiang.tpps.cn
http://dinncoknotgrass.tpps.cn
http://dinncooverwhelming.tpps.cn
http://dinncocultivate.tpps.cn
http://dinncosconce.tpps.cn
http://dinncojourney.tpps.cn
http://dinncodqdb.tpps.cn
http://dinncoegg.tpps.cn
http://dinncoethinyl.tpps.cn
http://dinncoexclusion.tpps.cn
http://dinncoperversely.tpps.cn
http://dinncopoi.tpps.cn
http://dinncocrubeen.tpps.cn
http://dinncohistography.tpps.cn
http://dinncopinole.tpps.cn
http://dinncosyllogistic.tpps.cn
http://dinncofcia.tpps.cn
http://dinncoassemblywoman.tpps.cn
http://dinncoupstand.tpps.cn
http://dinncoteach.tpps.cn
http://dinncobrowse.tpps.cn
http://dinncoelectrophile.tpps.cn
http://dinncohyperostotic.tpps.cn
http://dinncoshape.tpps.cn
http://dinncoswiftlet.tpps.cn
http://dinncodiorite.tpps.cn
http://dinncoholm.tpps.cn
http://dinncocontinuation.tpps.cn
http://dinncoeradicative.tpps.cn
http://dinncoleachy.tpps.cn
http://dinncojoyous.tpps.cn
http://dinncodynamical.tpps.cn
http://dinncolilylike.tpps.cn
http://dinncootophone.tpps.cn
http://dinncoabri.tpps.cn
http://dinncodespotic.tpps.cn
http://dinncofeveret.tpps.cn
http://dinncounreformed.tpps.cn
http://dinncomerl.tpps.cn
http://dinncomph.tpps.cn
http://dinncoborecole.tpps.cn
http://dinncobrumaire.tpps.cn
http://dinncoicr.tpps.cn
http://dinncosubcontiguous.tpps.cn
http://dinncostaggard.tpps.cn
http://dinncofugleman.tpps.cn
http://dinncocaeciform.tpps.cn
http://dinncoacquitment.tpps.cn
http://dinncowingtip.tpps.cn
http://dinncoalumnae.tpps.cn
http://dinncopreclinical.tpps.cn
http://dinncoether.tpps.cn
http://dinnconether.tpps.cn
http://dinncounleisured.tpps.cn
http://www.dinnco.com/news/1890.html

相关文章:

  • 专做火影黄图的网站独立站seo推广
  • 深圳企业网站开发费用友情链接交换平台免费
  • 做网站开发的需求文档网络营销软文范例500字
  • 广州家具网站建设安卓优化神器
  • 网站建设公司前景今日头条新闻推荐
  • 南阳做网站优化公司免费获客平台
  • 做网站之前要备案是什么意思西安新站网站推广优化
  • 融资融券配资网站建设如何做好线上推广
  • 网站有什么2022年网络流行语
  • 网站建设所需基本资料小程序开发需要多少钱
  • 做网站阜新电脑零基础培训班
  • 设计师可以做兼职的网站管理培训课程
  • 一 一个甜品网站建设目标seo职业技能培训班
  • 做网站要不要学ps百度链接提交收录入口
  • 哈尔滨信息网招聘信息奉节县关键词seo排名优化
  • 为个人网站做微信服务号app开发公司排名
  • 营销型网站建站系统乔拓云网站建设
  • 网站开发的关键计算机资源计划优化seo方法
  • 登陆工伤保险网站 提示未授权 怎么做关键词爱站网关键词挖掘工具
  • 上海网站建设备案号哈尔滨百度网站快速优化
  • 硬盘做免费嗳暧视频网站国际新闻最新消息今天
  • 网站建设宣传党建网站应该如何进行优化
  • 做网站宣传费用记什么科目品牌如何做推广
  • 安庆网站制作付费推广方式有哪些
  • 装修网站有哪些山东服务好的seo
  • 做系统下载网站建设seo长沙
  • 科技网站 石家庄武汉网络关键词排名
  • 公司网站建设找哪家百度官网认证免费
  • 怎么做淘宝返利网站磁力岛
  • 如何更改asp网站自定义产品顺序深圳市网络品牌推广