当前位置:网站首页>Fluent listview loads more
Fluent listview loads more
2022-04-22 08:30:00 【GuoXuan_ CHN】
Flutter ListView Load more
Realization function
- Load to the end
- Prevent frequent loading
- Load progress icon
- Show all tips
Function realization
Load to the end
stay initState() Add
@override
void initState() {
super.initState();
_scrollController.addListener(() {
if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {
//TODO The behavior triggered at the bottom
}
});
}
Prevent the network from loading frequently
Add... To the loading function
_getMoreData() async {
if (!isPerformingRequest) {
setState(() => isPerformingRequest = true);
//TODO Join the network request function call
List<*> newEntries = await requestNet();
setState(() {
list.addAll(newEntries);
isPerformingRequest = false;
});
}
}
explain
1.isPerformingRequest Is a global variable
2.list To show the List
Load icon
The following is the function to display the load icon
Widget _buildProgressIndicator() {
return new Padding(
padding: const EdgeInsets.all(8.0),
child: new Center(
child: new Opacity(
opacity: isPerformingRequest ? 1.0 : 0.0,
child: new CircularProgressIndicator(),
),
),
);
}
Show all tips
ListView.builder(
itemCount: list.length + 1,
itemBuilder: (context, index) {
if (index == list.length) {
return maxPageNum[arrayIndex] == currentPage[arrayIndex]
? _buildListEndView()
: _buildProgressIndicator();
} else {
return _buildShowUnit
}
},
controller: text == _TitleList[0] ? _incomeScrollController
: _outcomeScrollController,
);
Acknowledgement
reference : https://juejin.im/post/5b3abfc4518825622c14a6f1 . And sort it out by yourself . Infringement must be deleted .
appreciate
If it helps you , Stand by me , Thank you for 
版权声明
本文为[GuoXuan_ CHN]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220735463585.html
边栏推荐
- Variant quick platoon: find the largest number of top k
- 原来PID是在老王头和老斯基的斗争中诞生的
- Tensorflow usage notes
- JSON数据文本
- 每日一题冲刺大厂第十五天 终于结束的起点
- nacos基础(4):配置nacos外部数据库
- Pyqt5 uses the built-in database sqllite
- The collection palette in LabVIEW 2012 is imported into LabVIEW 2013
- 58 Technology Salon issue 28 - anjuke quality assurance system Salon
- sql需求处理篇-统计指定某年中有多少个周一至周日
猜你喜欢

广城云服务实现每天定时填写一日一报

The integrated optical access equipment provides 16 E1 service ports, 4 100m isolated networks and 2 Gigabit isolated Ethernet optical terminals

Redis非关系型数据库—Redis高可用、持久化及性能管理
SmartTabLayout 简介
![[quick link] a necessary calculation tool for Electronic Engineers - square wave circuit aided design form](/img/64/7c857ed94047f2a7b1d7be6d35e3b7.png)
[quick link] a necessary calculation tool for Electronic Engineers - square wave circuit aided design form

使⽤airtestIDE⽣成脚本,使⽤脚本运⾏

nacos基础(1):什么是配置中心&Nacos介绍

Magnesium oxide MgO crystal substrate | strontium titanate SrTiO3 crystal substrate | lithium niobate LiNbO3 crystal substrate; 10mm diameter

Make the airtest ide into a script and make the script run

Cloud computing learning 2 - keystone component operation and maintenance and testing
随机推荐
【无极低码】低代码平台开发日记,低代码平台之sql编程
js学习笔记
Fluorescently labeled hyaluronic acid
MaterialApp
进程和线程
广城云服务实现每天定时填写一日一报
Pyqt5 uses the built-in database sqllite
kubernetes—实战入门
SQL requirements processing - count the number of Mondays to Sundays in a given year
qt designer 跳转,布局,样式
关闭电脑端口
Phthalocyanine platinum CAS: 14075-08-2 | zinc phthalocyanine ZnPc | mesoporous silicon @ upconversion @ ZnPc photosensitizer, emission below 100nm 650nm
Redefine China's "core"
Winsock编程接口实验:实现ipconfig
面经:
每日一题冲刺大厂第十五天提高组 模
tensorflow使用笔记
Tita performance treasure: eight mistakes made by managers in performance appraisal
实验四、数据预处理
Fluorescent labeled polypeptide / amino acid (FITC modified / AMC modified) Qiyue organism