Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example how to update data #21

Open
mkoehne opened this issue Apr 21, 2023 · 0 comments
Open

Example how to update data #21

mkoehne opened this issue Apr 21, 2023 · 0 comments
Labels
improvement New feature or request

Comments

@mkoehne
Copy link

mkoehne commented Apr 21, 2023

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 mkoehne added the improvement New feature or request label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant