State
From: Stackoverflow
initState() is a method which is called once when the stateful widget is inserted in the widget tree.
We generally override this method if we need to do some sort of initialisation work like registering a listener because unlike
build() this method is called once.
And to unregister your listener (or doing some post work), you override
dispose()method.
Comments
Post a Comment