lazy_refreshing_listview 0.0.1
lazy_refreshing_listview: ^0.0.1 copied to clipboard
A flutter package to handle listview with refresh, and lazy scrolling smartly
# lazy_refreshing_listview
A smart and reusable Flutter widget that enables pull-to-refresh and infinite scroll (lazy loading) for any `ListView` with minimal setup.
---
## 🔧 Example
```dart
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('LazyRefreshingListView Example')),
body: Padding(
padding: const EdgeInsets.all(10.0),
child: LazyRefreshingListView(
onRefresh: _onRefresh,
onLazyLoad: _onLazyLoad,
listView: ListView.separated(
itemCount: items.length,
separatorBuilder: (_, __) => const SizedBox(height: 10.0),
itemBuilder: (_, index) {
final item = items[index];
return ListTile(
tileColor: Colors.grey[200],
title: Text(
limitWords(item['title'], 5),
style: const TextStyle(fontWeight: FontWeight.bold),
),
subtitle: Text(limitWords(item['body'], 10)),
);
},
),
),
),
);
}
📄 License #
MIT License © \Faysal Ahmed See the LICENSE file for details.