Immutable list of columns does not work with `TableColumnControlsPopupRoute`
@NikolayNIK never mind.. the problem was creating a new instance of the list of columns.. when using TableView.builder(columns: columns.toList(), ...) moving columns doesn't work either.. imho this is a (separate) bug, arguments to widgets should always be immutable.. by passing a mutable list into the TableView it's pretty random that moving columns works in the first place.. imho everything should work with passing a new list instance into the widget on every build (or when the list changes) as well..
Originally posted by @hpoul in https://github.com/NikolayNIK/material_table_view/issues/50#issuecomment-3172524823
The TableView and SliverTableView widgets are meant to be used either with mutable or immutable list of columns but TableColumnControlsPopupRoute column moving does not work whenever an immutable copy is passed to the table widget. Steps to reproduce:
- Replace the
columnsargument in the example toList.unmodifiable(columns). - Try to move a column and get an exception.