Revisiting the techniques
Let's begin by revising the concepts and keywords of all the techniques we have learned in this book, starting from the very basic—that is, setState
.
Note
Some techniques (such as InheritedWidget
and InheritedModel
, Business Logic Component (BLoC), Cubit, and so on) have been coupled together in a single subsection due to major similarities.
setState
We studied that setState
is the simplest form of state management in Flutter. This technique is used to rebuild your current widget and the widgets inside it whenever there is user interaction inside your widget. Some key points that we studied for setState
include the following:
- It is a function that allows you to rebuild your widget's
build
method with updated variables' values. Here is a short reminder of how it is used in the counterexample application:void _incrementCounter() { setState(() { _counter++;...