Update States authored by Nicholas Sarian's avatar Nicholas Sarian
......@@ -32,4 +32,4 @@ By adding the @immutable annotation to the abstract class, this indicates that a
In Flutter, @immutable is often used to make UI elements more efficient. Since UI elements are constantly being rebuilt, it is important that their state can be compared quickly and efficiently. By using @immutable, Dart can optimize the comparison process by only comparing the object's reference rather than its properties.
In the particular example previously method on this page, by marking the CreatePlayerState abstract class as immutable, any states that are instances of CreatePlayerState cannot be changed once they are created. This is important because the state of a widget in Flutter should only be changed by creating a new instance of a state object, rather than modifying the existing one.
\ No newline at end of file
In the example previously mentioned on this page, by marking the CreatePlayerState abstract class as immutable, any states that are instances of CreatePlayerState cannot be changed once they are created. This is important because the state of a widget in Flutter should only be changed by creating a new instance of a state object, rather than modifying the existing one.
\ No newline at end of file