tomasweigenast / paged-datatable

A DataTable widget for Flutter that supports cursor/offset pagination, filters and sorting
https://pub.dev/packages/paged_datatable
MIT License
15 stars 11 forks source link

Initial page size is always 100 #9

Closed philitell closed 8 months ago

philitell commented 8 months ago

Setting initial page size in theme-configuration is not used on initial startup.

 PagedDataTable<int, int, FullFeedback>(
          controller: tableController,
          theme: const PagedDataTableThemeData(
            configuration: PagedDataTableConfiguration(
              footer: PagedDataTableFooterConfiguration(footerVisible: true),
              allowRefresh: true,
              pageSizes: [20, 50],
              initialPageSize: 20,
            ),
          ),
          fetchPage: (pageToken, pageSize, sortBy, filtering) async {
            ....
          },
          idGetter: (FullFeedback feedback) => feedback.id ?? 0,
          initialPage: 0,

In this example initialPageSize is set to 20 but 100 is used. Changing page size after initial loading works as expected.

tomasweigenast commented 8 months ago

Thank you for reporting the error. This is now fixed!