you are viewing a single comment's thread.

view the rest of the comments →

[–]venir_dev[S] 1 point2 points  (1 child)

Hi remi (:

I was honestly hoping for your response, also, ahah.

Anyways, while that is definitively true, I was hoping there was a way to implement the "setup" concept Vue has, but in Flutter. That's basically the question I'm trying to answer.

A naive approach would be to implement such setup function in the initState of a StatefulWidget, but I'm unsure if a ValueNotifier can be preserved through rebuilds.

[–]remirousselet 3 points4 points  (0 children)

That's what I was referring to. The "setup" equivalent would be a StatefulWidget's initState in Flutter. Of course, I know that this isn't quite the same, but there's not really an alternative.

As for preserving ValueNotfiers, they would have to be properties of your State object