Flutter Stateless Widgets
If you look a user interface, it consists of many Widgets but not many of them have to be smart or interact with the user.
If you look at the default flutter application, there are several widgets but only in fact one Widget with any interactions with the user – the ‘MyHomePage’ Widget that has a counter that counts up when the user clicks on the floating button.
So, the rest of the widgets are used to display something, not interact with the user. That is what stateless widgets are for.
Minimum CodeHere is the minimum code you need for a Stateless Widget:
CreationStateless widgets are created by a parent widget in its ‘build’ method. They are given the information they need to do their job when they are created.
Stateless widgets receive arguments (information) from their parent widget in the ‘build’ method, which they store in final member variables.
Stored in member variable ‘make’.
Stored in member variable ‘model’.
Stored in member variable ‘imageSrc’.