Assume we are creating a stateful widget with a single property (or field) as follows
int counter;
I found two ways to modify the counter
:
First approach
counter++; setState((){}); // empty setState
Second approach
setState((){counter++;}); // wrapping setState
Question
Either approach produces the same result. The updated counter are shown visually in a Text
widget for example. I am wondering whether there are any other differences that are hard to see visually.