当前位置:网站首页>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
边栏推荐
- Data visualization: use Excel to make radar chart
- MySQL of database -- overview and installation
- js 原型链的深入
- GUI, CLI and UNIX Philosophy
- MySQL of database -- Fundamentals
- On array replication
- Buuctf [actf2020 freshman competition] include1
- What is monitoring intelligent playback and how to use intelligent playback to query video recording
- STM32 and FreeRTOS stack parsing
- 501. Mode in binary search tree
猜你喜欢

108. Convert an ordered array into a binary search tree

A must see wechat applet development guide 1 - basic knowledge

Machine learning (VI) -- Bayesian classifier

Installation of data cleaning ETL tool kettle

Flink SQL realizes the integration of stream and batch

資源打包關系依賴樹

Go language learning notes - language interface | go language from scratch

机器学习(六)——贝叶斯分类器
![Sql1 [geek challenge 2019]](/img/ad/afca09bc1da003393319af700e90e3.png)
Sql1 [geek challenge 2019]

#yyds干货盘点#ubuntu18.0.4安装mysql并解决ERROR 1698: Access denied for user ''root''@''localhost''
随机推荐
501. 二叉搜索树中的众数
108. 将有序数组转换为二叉搜索树
[SQL Server fast track] view and cursor of database
npm ERR! network
Flink SQL realizes the integration of stream and batch
ATSS(CVPR2020)
Leetcode-199 - right view of binary tree
GUI, CLI and UNIX Philosophy
Go language self-study series | golang structure pointer
Matlab draw five-star red flag
3、 6 [Verilog HDL] gate level modeling of basic knowledge
考研线性代数常见概念、问题总结
SAP 101K 411K 库存变化
Two ways for flutter providers to share data
Operation not allowed for a result set of type resultset TYPE_ FORWARD_ ONLY. Explain in detail
Thread scheduling (priority)
SQL used query statements
JS prototype chain
js 原型链的深入
Number theory to find the sum of factors of a ^ B (A and B are 1e12 levels)