Why are Statefulwidget and state separate classes?

There are multiple reasons : Widgets are immutable. Since the Stateful widget extends Widget it, therefore, must be immutable too. Splitting the declaration into two classes allows both the Stateful widget API to be immutable and State to be mutable .

Sizin İçin Seçtik  What is Flutter state?

Leave a Reply

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