zeba_academy_smart_scroll 0.1.0
zeba_academy_smart_scroll: ^0.1.0 copied to clipboard
A powerful Flutter package for infinite scrolling with offline caching, pull-to-refresh, lazy loading, scroll position persistence, and customizable loaders.
zeba_academy_smart_scroll #
A powerful and lightweight Flutter package for building high-performance scrollable UIs with infinite scrolling, offline caching, pull-to-refresh, and lazy loading.
⨠Features #
- š Infinite Scroll (Pagination)
- š„ Pull-to-Refresh Support
- ā” Lazy Loading for Lists & Grids
- š¾ Offline Caching (using SharedPreferences)
- š Scroll Position Persistence
- šØ Custom Loading Indicators
- š§© Easy to integrate & flexible API
š¦ Installation #
Add this to your pubspec.yaml:
dependencies:
zeba_academy_smart_scroll: ^0.1.0
Then run:
flutter pub get
š Usage #
Basic Example #
import 'package:flutter/material.dart';
import 'package:zeba_academy_smart_scroll/zeba_academy_smart_scroll.dart';
class ExamplePage extends StatefulWidget {
const ExamplePage({super.key});
@override
State<ExamplePage> createState() => _ExamplePageState();
}
class _ExamplePageState extends State<ExamplePage> {
List<String> items = [];
int page = 1;
bool hasMore = true;
@override
void initState() {
super.initState();
fetchData();
}
Future<void> fetchData() async {
await Future.delayed(const Duration(seconds: 1));
List<String> newItems =
List.generate(10, (index) => 'Item ${index + (page - 1) * 10}');
setState(() {
items.addAll(newItems);
if (page == 5) hasMore = false;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Smart Scroll Example')),
body: SmartListView<String>(
items: items,
hasMore: hasMore,
onRefresh: () async {
page = 1;
items.clear();
hasMore = true;
await fetchData();
},
onLoadMore: () async {
page++;
await fetchData();
},
itemBuilder: (context, item, index) {
return ListTile(title: Text(item));
},
),
);
}
}
š§ How It Works #
- Automatically detects when user reaches near bottom
- Triggers
onLoadMore() - Supports refresh using
RefreshIndicator - Keeps UI smooth with lazy rendering
šØ Custom Loader #
SmartListView(
loader: CircularProgressIndicator(),
)
š± Use Cases #
- š° News Apps
- š± Social Media Feeds
- š E-commerce Apps
- š Dashboards
- š Content-heavy apps
š Roadmap #
- ā GridView support
- ā Shimmer loading animation
- ā Riverpod / Bloc integration
- ā API pagination helpers
š¤ Contributing #
Contributions are welcome! Feel free to open issues or submit pull requests.
š License #
This project is licensed under the GPL License - see the LICENSE file for details.
šØāš» About Me #
⨠Iām Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at https://sufyanism.com or connect with me on https://www.linkedin.com/in/sufyanism
š Your all-in-one no-bloat hub! #
š Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! š»āØ
Zeba Academy is a learning platform dedicated to coding, technology, and development.
ā” Visit our main site: https://zeba.academy ā” Explore hands-on courses and resources at: https://code.zeba.academy ā” Check out our YouTube for more tutorials: https://www.youtube.com/@zeba.academy ā” Follow us on Instagram: https://www.instagram.com/zeba.academy/
ā If you like this package, don't forget to give it a star!