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

Is there a way to update variable without using setState, notifyListeners or any external packages? #33

Open
rafaelovandov opened this issue Jan 21, 2023 · 1 comment

Comments

@rafaelovandov
Copy link

No description provided.

@buttonsrtoys
Copy link
Owner

buttonsrtoys commented Apr 16, 2023

Yes. Variables in ViewModels are often called "properties" when using MVVM. To declare a variable (property), you can

  late final count = createProperty<int>(0);

And then update the property like

count = 5;

or

count++;

mvvm_plus uses notifyListeners under the hood to notify listeners that the value has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants