Lifecycle Methods of Flutter Stateful Widgets

Unlike stateless widgets, the stateful widget is more complex and has more lifecycle methods. In this case of a stateful widget, the state object lives a lot longer. So it has got more life cycle widgets.

Stateful Widget Lifecycle Methods

initState()

Gets called when that state initially gets initialized.

build()

Gets called when the widgets are actually built and will show up on the screen.

deactivate()

Gets called when that stateful widget gets destroyed.

About the Author: smartcoder

You might like

Leave a Reply

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