Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 22.214.171.124 release ready!
Owner and Founder. Opencart
Lifecycle of Flutter App, is the demonstration of how the app will change its State.
It helps in understanding the concept behind the smooth flow of our apps.
Flutter has majorly two types of widgets i.e. , Stateless and Stateful Widget.
Stateless Widget – Stateless Widgets are those widgets which do not have to manage the State as they do not change dynamically at runtime.
Stateful Widget – Stateful Widgets are those widgets which holds the State and the user interface being described can change dynamically at runtime.
So, as we are discussing about the LifeCycle of Flutter, we will be concentrating on ‘Stateful Widgets‘ as they have to manage the State.
This method is called when we create a new Stateful Widget.It is a mandatory method . It will return an instance of a State associated with it.
This is the method which is called when the Widget is created for the first time and it is called exactly once for each State object.
If we define or add some code in initState() method then this code will execute first even before the widgets are being built.
This method is called immediately after initState() method on the first time the widget is built.
This method is the most important method as the rendering of all the widgets depends on it.
It is called every time when we need to render the UI Widgets on the screen.
This method is used when there is some change in the configuration by Parent widget.
It is basically called every time we hot reload the app for viewing the updates made to the widget.
The setState() method informs the framework that the internal state of this object has changed in a way that might impact the UI which causes the framework to schedule a build for this State of object.
It is an error to call this method after the framework calls dispose.
This method is called when the State is removed from the tree, but this method can be also be re-inserted into the tree in some other part.
This method is basically the opposite of initState() method and is also very important.
It called when the object and its State needs to be removed from the Widget Tree permanently and will never build again.
In this blog, we have discussed about the lifecycle of flutter app.
I hope this blog will help you in understanding of Lifecycle in a better way.
Thank you for reading!!
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.