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

Observable and reactive variables can not be final #3256

Open
akhdari opened this issue Nov 16, 2024 · 1 comment
Open

Observable and reactive variables can not be final #3256

akhdari opened this issue Nov 16, 2024 · 1 comment
Assignees

Comments

@akhdari
Copy link

akhdari commented Nov 16, 2024

Problem:
in getx/documentation/en_US
/state_management.md
Starting from this part of the documentation https://github.com/jonataslaw/getx/blob/master/documentation/en_US/state_management.md#declaring-a-reactive-variable,
in the examples provided, observable and reactive variables are declared with their access modifiers set to final.

Solution:
Replace final with var.

Reason for the modification:
Reactive and observable variables are mutable and cannot be set to final.

@brasizza
Copy link

Actually the properties is not mutable, the reactivity is.

final name = "marcus".obs;
Name is final and cannot been changed, but name.value = "MARCUS"; can.

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

3 participants