jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.41k stars 1.63k forks source link

Observable and reactive variables can not be final #3256

Open akhdari opened 6 days ago

akhdari commented 6 days ago

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 commented 2 days ago

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.