当前位置:网站首页>Shuttle simulated rocket launch animation
Shuttle simulated rocket launch animation
2022-07-18 14:01:00 【InfoQ】
Preface

AnimatedPositionedAnimatedPositioned
Effect description
- Higher and higher , In fact, it can be realized by increasing the position relative to the bottom of the picture background ;
- Smaller and smaller , This can control the size of the whole component .
easeInCubicAnimatedPositioned
Introduce
AnimatedPositionedAnimatedPositionedPositionedconst AnimatedPositioned({
Key? key,
required this.child,
this.left,
this.top,
this.right,
this.bottom,
this.width,
this.height,
Curve curve = Curves.linear,
required Duration duration,
VoidCallback? onEnd,
})
PositionedAnimatedContainercurve: Animation effect curve ;
duration: Animation duration ;
onEnd: Callback after animation .
lefttopwidthbottomwidthRocket launch animation
class RocketLaunch extends StatefulWidget {
RocketLaunch({Key? key}) : super(key: key);
@override
_RocketLaunchState createState() => _RocketLaunchState();
}
class _RocketLaunchState extends State<RocketLaunch> {
var rocketBottom = -80.0;
var rocketWidth = 160.0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(' Rocket launching '),
brightness: Brightness.dark,
backgroundColor: Colors.black,
),
backgroundColor: Colors.black,
body: Center(
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Image.asset(
'images/earth.jpeg',
height: double.infinity,
fit: BoxFit.fill,
),
AnimatedPositioned(
child: Image.asset(
'images/rocket.png',
fit: BoxFit.fitWidth,
),
bottom: rocketBottom,
width: rocketWidth,
duration: Duration(seconds: 5),
curve: Curves.easeInCubic,
),
],
),
),
floatingActionButton: FloatingActionButton(
child: Text(
' launch ',
style: TextStyle(
color: Colors.white,
),
textAlign: TextAlign.center,
),
onPressed: () {
setState(() {
rocketBottom = MediaQuery.of(context).size.height;
rocketWidth = 40.0;
});
},
),
);
}
}
bottomsetStatesummary
AnimatedPositionedAnimatedPositionedAnimatedPositioned
边栏推荐
- [JMeter] the Chinese display of JMeter response message is garbled
- 文旅夜游:城市经济复苏增长新机遇
- marginalization
- 单自由度系统的随机振动计算与仿真验证
- 騰訊員工發帖找對象,錶示偏愛程序員!評論火了......丨黑馬頭條
- Thread safety problems and solutions of simpledateformat
- Iptables mask access to a port of IP
- Detailed steps for T100 to develop a new two gear program
- Golang---------小试牛刀 gin框架文件上传
- Flutter ListView controller. Animateto is invalid
猜你喜欢

math_排序不等式的推导

关系图/族谱

PMP practice once a day | don't get lost in the exam -7.14

The principle and implementation of PageRank

关于XML文件(五)

Optimization design of video processing and codec hardware system

PMP每日一练 | 考试不迷路-7.14

What points should be paid attention to in the selection of project management system?

kettle版本8.2的中文乱码问题

2.4_ 9 MySQL by separator, row to column
随机推荐
MySQL常用查询
preg_replace 代码执行漏洞之[BJDCTF2020]ZJCTF,不过如此
Three lines (spring daily question 59)
ubuntu 18.04 使用 tar包安装mysql5.7.35
SimpleDateFormat 的线程安全问题与解决方案
2018 Jiangsu Provincial Information and future programming expert competition test question -- (New) chicken and rabbit in the same cage standard schedule
[JMeter] the Chinese display of JMeter response message is garbled
Flutter ListView controller. Animateto is invalid
Can ping command still play like this?
marginalization
Matlab机械臂建模运动学仿真+轨迹规划
PhpMyAdmin 4.8.1 remote file contains vulnerability [gwctf 2019] I have a database
T100excel导入写法模板
The writing method of like% variable% in Oracle SQL
PMP practice once a day | don't get lost in the exam -7.14
kettle版本8.2的中文乱码问题
【目标跟踪】基于背景消减的图像帧间差分法目标检测及matlab仿真
Enterprise OA system based on SSM, high-quality paper examples, attached source code, database script, project introduction and operation tutorial, Paper Writing Tutorial
清楚临时表、查看临时表占用内存
Quarkus practice 2: develop rest ful services to realize simple curd functions