The widgets contain their life cycle and it is stateless. We want structures to stay the same all over the app. For example, AppBar, Textview, etc. widgets are immutable. Flutter provides a Hot Reload that can reflect changes in the application.
The life cycle of stateless widgets is simple: only one stage of the build method is called automatically while running the application.
Example:
There are methods for the life cycle of flutter widgets.
Init State ():
The init state gets triggered when the application is run. We want something to happen the moment our stateful widget is created.
Build ():
The build method is triggered when the widget is constructed and the UI loads on the screen. This method is called every time while running the application.
Deactivated():
The Deactivate method is called when the stateful widget is destroyed. This method is used for destroying objects and variables.
Example of the life cycle:
Happy Coding!