Why does StatefulWidget need to be immutable?

StatefulWidgets are separated into 2 classes because one part is entirely immutable . Widget subclass cannot store any mutable field. We are not in React where “Components” are mutable and the instance stays the same for the whole life of the component.

Sizin İçin Seçtik  How do you create a constructor in flutter for stateful widget?

Leave a Reply

Your email address will not be published. Required fields are marked *