Skip to content

YemenOpenSource/pagination_easy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stand With Palestine

StandWithPalestine

pagination_easy_plugin

A Flutter widget for pagination .

Installation

Run flutter pub add pagination_easy

Or

add pagination_easy as a dependency in your pubspec.yaml file. and run flutter pub get.

Usage

To use this plugin,

import 'package:pagination_easy/pagination_controller.dart';
import 'package:pagination_easy/pagnation_widget.dart';


late PaginationController<Product> paginationController;
  
  
   @override
  void initState() {
     paginationController = PaginationController<Product>(
             (int pageKey) => getData(pageKey));
        
    
  }
    Future<List<Product>> getData(int pageKey) async {
    //write your code
    }



    ///
SingleChildScrollView(
controller: controller.paginationController.scrollController,
          
            child:...
                    PaginationWidget(
                                      itemBuilder: (BuildContext context, item,
                                              int index) =>
                                          YourWidget(
                                          product:item
                                      ),
                                      controller:
                                         paginationController,
                                      emptyWidget: const EmptyDataWidget(),
                                      bottomLoader: Center(
                                        child:
                                           CircularProgressIndicator(),
                                      ),
                                    )

Connect with me:

amjad_alhetary amjad_alhetary amjad_alhetary

About

A Flutter widget for pagination

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages