当前位置:网站首页>Flutter 的加载动画这么玩更有趣
Flutter 的加载动画这么玩更有趣
2022-04-23 09:24:00 【岛上码农】
前言
我们使用 Stack 组件的时候,通常会使用 Positioned 组件来做子组件相对 Stack 的定位,Positioned 通过 top,bottom,height 三选二确定垂直方向的位置和尺寸,使用 left,right 和 width 三选二确定水平方向的位置和尺寸。对应的,我们可以使用 AnimatedPositioned 组件来实现子组件在 Stack 中的移动、尺寸变化等其他效果。本篇我们用这个组件构建两个球追逐的动画效果,以便全面了解这个组件的使用。

效果解析
从动图可以看到,蓝色球和橙色球会一先一后沿着白色大圆的左、下、右、上顶点移动,同时在启动切换的时候会有弹入效果。具体实现的逻辑如下:
- 沿着大圆4个点移动效果,我们可以控制球的起始位置就可以搞定了。
- 弹入效果则可以使用
bounceIn曲线实现。 - 对一先一后的追逐效果,可以设置一个有序的位置数组,一个球的位置是另一个球的下一个位置,可以通过使用不同的下标从位置数组取取位置实现。
- 重复动效的实现:重复动效使用
AnimatedPositioned的onEnd触发&
版权声明
本文为[岛上码农]所创,转载请带上原文链接,感谢
https://blog.csdn.net/shuijian00/article/details/124356123
边栏推荐
- Strength comparison vulnerability of PHP based on hash algorithm
- Machine learning (VI) -- Bayesian classifier
- Colorui solves the problem of blocking content in bottom navigation
- How does kubernetes use harbor to pull private images
- npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’
- Base de la technologie électronique numérique 3.1 aperçu du circuit de porte, 3.2 circuit de porte à diode semi - conductrice
- Emuelec compilation summary
- npm ERR! network
- Kettle experiment conversion case
- RSA encryption and decryption signature verification
猜你喜欢

DVWA range practice

Harbor enterprise image management system

MySQL small exercise (only suitable for beginners, non beginners are not allowed to enter)

Using JS to realize a thousandth bit

Kettle实验 (三)

What is augmented reality technology? Where can it be used?

Kettle experiment

Project upload part

Set the maximum width of the body, but why does the background color of the body cover the whole page?

MySQL小练习(仅适合初学者,非初学者勿进)
随机推荐
Summary of common concepts and problems of linear algebra in postgraduate entrance examination
搞不懂时间、时间戳、时区,快来看这篇
员工试用期转正申请书(泸州老窖)
How to read excel table to database
Failed to prepare device for development
成功的DevOps Leader 应该清楚的3个挑战
[SQL Server fast track] view and cursor of database
Applet error: should have URL attribute when using navigateto, redirectto or switchtab
Production practice elk
112. 路径总和
Colorui solves the problem of blocking content in bottom navigation
On array replication
Emuelec compilation summary
OpenCV中的图像处理 —— 轮廓入门+轮廓特征
Number of islands
MySQL - Chapter 1 (data type 2)
SAP 101K 411K 库存变化
Program, process, thread; Memory structure diagram; Thread creation and startup; Common methods of thread
web页面如何渲染
Cloud computing competition -- basic part of 2020 competition [task 3]