Mutable Class https://gist.github.com/pmatatias/a87bc52f1c766780270d7653e0428cee
-
Non-final Variables: In a mutable class, variables are not declared as final. This allows their values to be changed directly after the object's creation.
-
Direct State Manipulation: You can modify these variables directly from anywhere in the app, including the UI. For example, calling friendList.removeLast directly modifies the internal state of the object.
-
Potential Issue: The risk here is that if you change the state directly without properly notifying the UI (like using notifyListeners() in Flutter), the UI might not update to reflect this change. This can lead to inconsistencies and hard-to-track bugs, especially in more complex applications.