swayze icon indicating copy to clipboard operation
swayze copied to clipboard

Example how to update data

Open mkoehne opened this issue 2 years ago • 0 comments

Summary

I would be super helpful to have an example of how to change data. For example I want to create a new cell or change a cells position. What is the best way to update the UI?

Thank you very much that you have made your code open source 💙

Acceptance criteria

Technical details

I found the putRawCells method in the SwayzeCellsController and it uses updateState. I tried to use it like this: cellsController.updateState((modifier) { modifier.putCell(cellParser(element)); });

But I will not update the UI. It only adds the new cell to the matrix but is does not trigger a rebuild. Only when I scroll so far that the cell is not visible any more and scroll back then it renders the new cell.

mkoehne avatar Apr 21 '23 14:04 mkoehne