maxim-saplin / data_table_2

In-place substitute for Flutter's DataTable and PaginatedDataTable with fixed/sticky header and extra features
https://pub.dev/packages/data_table_2
BSD 3-Clause "New" or "Revised" License
202 stars 135 forks source link

Fix for #254, How to have selected rows on table create with AsyncDataTableSource? #271

Closed MogensO closed 5 months ago

MogensO commented 5 months ago

Fixes #254 I just changed line 116 of AsyncDataTableSource setting the selected argument of the _clone method to true.

maxim-saplin commented 5 months ago

If I get the change right... It will always make the rows selected by default, correct?

MogensO commented 5 months ago

Yes but only if the surrounding _rows[rowIndex].selected == true.

maxim-saplin commented 5 months ago

One of the tests is failing, the change breaks old behaviour: ❌ /Users/runner/work/data_table_2/data_table_2/test/custom_features_test.dart: AsyncPaginatedDataTable2 Select/deselect all (failed)