In flutter, widgets can be divided into two categories:
- Stateless Widget: A widget that does nothing is a Stateless Widget. In essence, they are static and don’t store any state. Thus, they don’t save values that may change.
- Stateful Widget: A widget that does anything is a Stateful Widget. Stateful widgets are dynamic by nature, which means they can monitor changes and update the UI accordingly.
Flutter widgets are built using a modern framework that takes inspiration from React. The central idea is that you build your UI out of widgets. Widgets describe what their view should look like given their current configuration and state. When a widget’s state changes, the widget rebuilds its description, which the framework diffs against the previous description in order to determine the minimal changes needed in the underlying render tree to transition from one state to the next.