CustomPagination<T> constructor

const CustomPagination<T>({
  1. Key? key,
  2. required Widget itemBuilder(
    1. BuildContext,
    2. T
    ),
  3. required Widget onError(
    1. dynamic
    ),
  4. required Widget onEmpty,
  5. required PaginationBuilder<T> fetchMethod,
  6. bool isGridView = false,
  7. int crossAxisCount = 1,
  8. double mainAxisExtent = 100,
  9. double mainAxisSpacing = 10,
  10. double crossAxisSpacing = 10,
  11. Axis scrollDirection = Axis.vertical,
  12. bool shrinkWrap = false,
  13. EdgeInsets padding = const EdgeInsets.all(0),
  14. List<T> initialData = const [],
  15. ScrollPhysics? physics,
  16. Widget separatorWidget = const SizedBox(height: 0, width: 0),
  17. Widget onPageLoading = const Center(child: Padding(padding: EdgeInsets.all(16.0), child: SizedBox(height: 25, width: 25, child: CircularProgressIndicator(valueColor: AlwaysStoppedAnimation<Color>(Color.fromARGB(255, 171, 100, 184)), backgroundColor: Colors.purple)))),
  18. Widget onLoading = const SizedBox(height: 25, width: 25, child: CircularProgressIndicator(valueColor: AlwaysStoppedAnimation<Color>(Color.fromARGB(255, 171, 100, 184)), backgroundColor: Colors.purple)),
})

Implementation

const CustomPagination({
  Key? key,
  required this.itemBuilder,
  required this.onError,
  required this.onEmpty,
  required this.fetchMethod,
  this.isGridView = false,
  this.crossAxisCount = 1,
  this.mainAxisExtent = 100,
  this.mainAxisSpacing = 10,
  this.crossAxisSpacing = 10,
  this.scrollDirection = Axis.vertical,
  this.shrinkWrap = false,
  this.padding = const EdgeInsets.all(0),
  this.initialData = const [],
  this.physics,
  this.separatorWidget = const SizedBox(height: 0, width: 0),
  this.onPageLoading = const Center(
    child: Padding(
      padding: EdgeInsets.all(16.0),
      child: SizedBox(
        height: 25,
        width: 25,
        child: CircularProgressIndicator(
          valueColor: AlwaysStoppedAnimation<Color>(Color.fromARGB(255, 171, 100, 184)),
          backgroundColor: Colors.purple,
        ),
      ),
    ),
  ),
  this.onLoading = const SizedBox(
    height: 25,
    width: 25,
    child: CircularProgressIndicator(
      valueColor: AlwaysStoppedAnimation<Color>(Color.fromARGB(255, 171, 100, 184)),
      backgroundColor: Colors.purple,
    ),
  ),
}) : super(key: key);