zeba_academy_smart_scroll 0.1.0 copy "zeba_academy_smart_scroll: ^0.1.0" to clipboard
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!


0
likes
140
points
71
downloads

Documentation

API reference

Publisher

verified publisherzeba.academy

Weekly Downloads

A powerful Flutter package for infinite scrolling with offline caching, pull-to-refresh, lazy loading, scroll position persistence, and customizable loaders.

Homepage

Topics

#infinite-scroll #pagination #lazy-loading #listview #flutter-ui

License

GPL-3.0 (license)

Dependencies

flutter, shared_preferences

More

Packages that depend on zeba_academy_smart_scroll