SfDataPager constructor

const SfDataPager({
  1. required double pageCount,
  2. required DataPagerDelegate delegate,
  3. Key? key,
  4. Axis direction = Axis.horizontal,
  5. double itemWidth = 50.0,
  6. double itemHeight = 50.0,
  7. EdgeInsetsGeometry itemPadding = const EdgeInsets.all(5),
  8. double navigationItemHeight = 50.0,
  9. double navigationItemWidth = 50.0,
  10. bool firstPageItemVisible = true,
  11. bool lastPageItemVisible = true,
  12. bool nextPageItemVisible = true,
  13. bool previousPageItemVisible = true,
  14. int visibleItemsCount = 5,
  15. int initialPageIndex = 0,
  16. DataPagerItemBuilderCallback<Widget>? pageItemBuilder,
  17. PageNavigationStart? onPageNavigationStart,
  18. PageNavigationEnd? onPageNavigationEnd,
  19. ValueChanged<int?>? onRowsPerPageChanged,
  20. List<int> availableRowsPerPage = const <int>[10, 15, 20],
  21. DataPagerController? controller,
})

Creates a widget describing a datapager.

The pageCount and delegate argument must be defined and must not be null.

Implementation

const SfDataPager(
    {required this.pageCount,
    required this.delegate,
    Key? key,
    this.direction = Axis.horizontal,
    this.itemWidth = 50.0,
    this.itemHeight = 50.0,
    this.itemPadding = const EdgeInsets.all(5),
    this.navigationItemHeight = 50.0,
    this.navigationItemWidth = 50.0,
    this.firstPageItemVisible = true,
    this.lastPageItemVisible = true,
    this.nextPageItemVisible = true,
    this.previousPageItemVisible = true,
    this.visibleItemsCount = 5,
    this.initialPageIndex = 0,
    this.pageItemBuilder,
    this.onPageNavigationStart,
    this.onPageNavigationEnd,
    this.onRowsPerPageChanged,
    this.availableRowsPerPage = const <int>[10, 15, 20],
    this.controller})
    : assert(pageCount > 0),
      assert(itemHeight > 0 && itemWidth > 0),
      assert(availableRowsPerPage.length != 0),
      assert((firstPageItemVisible ||
              lastPageItemVisible ||
              nextPageItemVisible ||
              previousPageItemVisible) &&
          (navigationItemHeight > 0 && navigationItemWidth > 0)),
      super(key: key);