当前位置:网站首页>Flutter 实现每次进来界面都刷新数据
Flutter 实现每次进来界面都刷新数据
2022-07-01 05:08:00 【明似水】
前言
最近做flutter项目的时候,想每次进入我的界面都刷新数据,发现了一个很好用的方法,在此分享给大家:
@override
Widget build(BuildContext context) {
return VisibilityDetector(
key: const Key('my-menu-key'),
onVisibilityChanged: (VisibilityInfo visibilityInfo) {
if (visibilityInfo.visibleFraction == 0.0) {
} else {
_getMemberInfo();
}
},
child: Scaffold(
backgroundColor: color_FFFFFFFF,
body: Container(
color: Colors.red,
),
),
);
}
}
关键是VisibilityDetector,然后判断是否显示,就可以实现自己的效果了!
END.
边栏推荐
- [hard ten treasures] - 1 [basic knowledge] classification of power supply
- LeetCode_ 58 (length of last word)
- LeetCode522-最长特殊序列II-哈希表-字符串-双指针
- Use of STM32 expansion board temperature sensor and temperature humidity sensor
- Neural network convolution layer
- [daily question in summer] function of rogu p3742 UMI
- 复制宝贝提示材质不能为空,如何解决?
- 0xc000007b应用程序无法正常启动解决方案(亲测有效)
- [FTP] the solution to "227 entering passive mode" during FTP connection
- LeetCode_ 35 (search insertion position)
猜你喜欢

Use and modification of prior network model

Neural networks - use sequential to build neural networks

Intelligent operation and maintenance: visual management system based on BIM Technology

Fitness without equipment

Sqlplus connects using the instance name

Distributed architecture system splitting principles, requirements and microservice splitting steps

複制寶貝提示材質不能為空,如何解决?

智慧运维:基于 BIM 技术的可视化管理系统

液压滑环的特点讲解
![[data recovery in North Asia] a data recovery case of raid crash caused by hard disk drop during data synchronization of hot spare disk of RAID5 disk array](/img/22/606ff1e8dad3d5896b32d2146b0477.jpg)
[data recovery in North Asia] a data recovery case of raid crash caused by hard disk drop during data synchronization of hot spare disk of RAID5 disk array
随机推荐
Intelligent operation and maintenance: visual management system based on BIM Technology
1076 Forwards on Weibo
AcWing 885. Find the combination number I (recursive preprocessing)
线程类的几大创建方法
LevelDB源码分析之LRU Cache
【暑期每日一题】洛谷 P2637 第一次,第二次,成交!
LeetCode_ 53 (maximum subarray and)
Global and Chinese markets for soft ferrite cores 2022-2028: Research Report on technology, participants, trends, market size and share
Youqitong [vip] v3.7.2022.0106 official January 22 Edition
对象的序列化与反序列化
1076 Forwards on Weibo
LeetCode_ 35 (search insertion position)
Global and Chinese market of mainboard 2022-2028: Research Report on technology, participants, trends, market size and share
0xc000007b应用程序无法正常启动解决方案(亲测有效)
JS to solve the problem of floating point multiplication precision loss
Serialization and deserialization of objects
Sqlplus connects using the instance name
How to meet the requirements of source code confidentiality and source code security management
How to start learning editing? Detailed analysis of zero basis
Global and Chinese market of paper machine systems 2022-2028: Research Report on technology, participants, trends, market size and share