loadany
Flutter load more package , support ListView、GridView、Slivers
- Stars
- 26
- Forks
- 7
- Last push (UTC)
- May 12, 2021
- Project status
- Active
Original README
English project snapshot. Visit GitHub for the latest content.
LoadAny
A new Flutter loads more package.
Website
Support
- CustomScrollView
- SliverListView
- SliverGridView
- SliverListView substitute ListView
- SliverGridView substitute GridView
- Custom loading style
- External nested RefreshIndicator
- Feed streaming
Usage
- Add LoadAny
import 'package:loadany/loadany.dart';
LoadStatus status = LoadStatus.normal;
LoadAny(
onLoadMore: getLoadMore,
status: status,
footerHeight: 40,
endLoadMore: true,
bottomTriggerDistance: 200,
child: CustomScrollView(
slivers: <Widget>[
SliverGrid(...),
SliverList(...),
],
),
)
/// Load More Get Data
Future<void> getLoadMore() async {
setState(() {
status = LoadStatus.loading;
});
Timer.periodic(Duration(milliseconds: 5000), (Timer timer) {
timer.cancel();
int length = list.length;
for (var i = 1; i < 11; ++i) {
list.add(length + i);
}
if (length > 80) {
status = LoadStatus.completed;
} else if (length >= 50 && length < 70) {
status = LoadStatus.error;
} else {
status = LoadStatus.normal;
}
setState(() {});
});
}
Getting Started
Screenshot
- Loading
- Error
- Completed
Issues and feedback
Please file issues to send feedback or report a bug. Thank you!
关注我
- 遇到问题可以找我帮助解决(联系方式在
GitHub主页) - 持续分享优质的
Flutter文章和视频 - 不定期分享
Flutter开发小技巧 - 百万级
Flutter应用架构经验
LanguagesDartSwiftHTMLJavaKotlinObjective-C
Categories
Dependencies used
Dependency list 2 items
- flutter
{"sdk":"flutter"} - flutter_testDevelopment
{"sdk":"flutter"}
How do I choose a repository?
Start with your use case, compare repository activity, and check the original project before adopting it.
- Search by repository name, owner or description, then narrow the results by topic.
- Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
- Read the README, license and issues on GitHub before using a project.
Sources and maintenance
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗
- BytesZero/loadany · GitHub ↗
- GitHub Docs — Saving repositories with stars ↗
- Directory maintained by Ducafecat ↗