Flutter 淡入淡出效果(1),成功入职网易月薪35K

本文详细介绍了如何在Flutter应用中使用AnimatedOpacity类创建逐级显示和隐藏的动画容器,展示了如何控制透明度和动画时长。此外,还提到了学习Android开发资源的重要性,尤其是对于系统化和面试准备的价值。
摘要由CSDN通过智能技术生成

@override

_AnimatedContainerAppState createState() => _AnimatedContainerAppState();

}

class _AnimatedContainerAppState extends State {

bool _visible = true;

@override

Widget build(BuildContext context) {

return MaterialApp(

home: Scaffold(

body: Center(

child: AnimatedOpacity(

//opacity=0.0透明

//opacity=1.0完全显示

opacity: _visible ? 1.0 : 0.0,

duration: Duration(milliseconds: 500),

// The green box must be a child of the AnimatedOpacity widget.

child: Container(

width: 200.0,

height: 200.0,

color: Colors.blue,

),

),

),

floatingActionButton: FloatingActionButton(

child: Icon(Icons.play_arrow),

onPressed: () {

setState(() {

_visible = !_visible;

});

},

),

),

);

}

}

lass AnimatedContainerApp extends StatefulWidget {

@override

_AnimatedContainerAppState createState() => _AnimatedContainerAppState();

}

class _AnimatedContainerAppState extends State {

bool _visible = true;

@override

Widget build(BuildContext context) {

return MaterialApp(

home: Scaffold(

body: Center(

child: Stack(

children: [

AnimatedOpacity(

opacity: _visible ? 1.0 : 0.0,

duration: Duration(milliseconds: 3000),

// The green box must be a child of the AnimatedOpacity widget.

child: Container(

width: 350.0,

height: 350.0,

color: Colors.blue.withOpacity(0.2),

child: Text(‘1’),

alignment: Alignment.bottomRight,

),

curve: Curves.linear,

),

AnimatedOpacity(

opacity: _visible ? 1.0 : 0.0,

duration: Duration(milliseconds: 2500),

// The green box must be a child of the AnimatedOpacity widget.

child: Container(

width: 300.0,

height: 300.0,

color: Colors.blue.withOpacity(0.3),

child: Text(‘2’),

alignment: Alignment.bottomRight,

),

curve: Curves.linear,

),

AnimatedOpacity(

opacity: _visible ? 1.0 : 0.0,

duration: Duration(milliseconds: 2500),

// The green box must be a child of the AnimatedOpacity widget.

child: Container(

width: 250.0,

height: 250.0,

color: Colors.blue.withOpacity(0.4),

child: Text(‘3’),

alignment: Alignment.bottomRight,

),

curve: Curves.linear,

),

AnimatedOpacity(

opacity: _visible ? 1.0 : 0.0,

duration: Duration(milliseconds: 2000),

// The green box must be a child of the AnimatedOpacity widget.

child: Container(

width: 200.0,

height: 200.0,

color: Colors.blue.withOpacity(0.5),

child: Text(‘4’),

alignment: Alignment.bottomRight,

),

curve: Curves.linear,

),

AnimatedOpacity(

opacity: _visible ? 1.0 : 0.0,

duration: Duration(milliseconds: 1500),

// The green box must be a child of the AnimatedOpacity widget.

child: Container(

width: 150.0,

height: 150.0,

color: Colors.blue.withOpacity(0.6),

alignment: Alignment.bottomRight,

child: Text(‘5’),

),

curve: Curves.linear,

),

AnimatedOpacity(

opacity: _visible ? 1.0 : 0.0,

duration: Duration(milliseconds: 1000),

// The green box must be a child of the AnimatedOpacity widget.

child: Container(

width: 100.0,

height: 100.0,

color: Colors.blue.withOpacity(0.64),

alignment: Alignment.bottomRight,

child: Text(‘6’),

),

curve: Curves.linear,

),

AnimatedOpacity(

opacity: _visible ? 1.0 : 0.0,

duration: Duration(milliseconds: 500),

// The green box must be a child of the AnimatedOpacity widget.

child: Container(

width: 50.0,

height: 50.0,

alignment: Alignment.bottomRight,

color: Colors.blue.withOpacity(0.98),

child: Text(‘7’),

),

curve: Curves.linear,

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

img

img

img

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)

如何做好面试突击,规划学习方向?

面试题集可以帮助你查漏补缺,有方向有针对性的学习,为之后进大厂做准备。但是如果你仅仅是看一遍,而不去学习和深究。那么这份面试题对你的帮助会很有限。最终还是要靠资深技术水平说话。

网上学习 Android的资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。建议先制定学习计划,根据学习计划把知识点关联起来,形成一个系统化的知识体系。

学习方向很容易规划,但是如果只通过碎片化的学习,对自己的提升是很慢的。

我们搜集整理过这几年字节跳动,以及腾讯,阿里,华为,小米等公司的面试题,把面试的要求和技术点梳理成一份大而全的“ Android架构师”面试 Xmind(实际上比预期多花了不少精力),包含知识脉络 + 分支细节。

img

我们在搭建这些技术框架的时候,还整理了系统的高级进阶教程,会比自己碎片化学习效果强太多

《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

提升是很慢的。

我们搜集整理过这几年字节跳动,以及腾讯,阿里,华为,小米等公司的面试题,把面试的要求和技术点梳理成一份大而全的“ Android架构师”面试 Xmind(实际上比预期多花了不少精力),包含知识脉络 + 分支细节。

[外链图片转存中…(img-uSc5jJDe-1712509617867)]

我们在搭建这些技术框架的时候,还整理了系统的高级进阶教程,会比自己碎片化学习效果强太多

《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值