stacked icon indicating copy to clipboard operation
stacked copied to clipboard

[bug]: createNewViewModelOnInsert Does not Create a new View model when widget is being re inserted in the tree

Open meetdagm opened this issue 1 year ago • 1 comments

Describe the bug

  1. I have a parent widget that is notified by it's view model.
  2. When the parent is notified to rebuild the widget tree it build a child widget that has it's own viewModel
  3. This child widget's constructor and build methods are being called but the view model builder is not being triggered.

How is this even possible???????

To reproduce

  1. Create a parent widget with it's own viewmodel
  2. trigger a UI rebuild from the viewmodel using notifyListeners()
  3. Create a child widget that uses a value that's being updated from the parent view model
  4. When this child widget get's rebuild on notify Listeners, the child widget will get re-built but the value in the child widget's viewmodel is still using the old value that it got during the initial build from the parent

Expected behavior

No response

Screenshots

No response

Additional Context

No response

meetdagm avatar Dec 27 '23 21:12 meetdagm

Interesting, can you please make a small example using the stacked_cli to generate the app.

This will allow us to reproduce and see what you need and fix it.

FilledStacks avatar Jan 25 '24 09:01 FilledStacks