if I’m changing multiple values, then I just so setState((){}) as the last line in the method
With multiple values, I still prefer doing this:
setState(() { // ... _value1 = "blah"; _value2 = 123; _value3 = true; });
Like Randall said, it feels more like a self-documenting piece of code that way ¯_(ツ)_/¯ An empty function inside setState also somehow looks like there's something missing.
setState
Different strokes for different folks.
GitHub-flavored Markdown & a sane subset of HTML is supported.
Fill in your email address if you want to get notified when someone replies to your comment. Your email address is safely stored with strong 256-bit AES encryption. You can unsubscribe from notification emails any time by following a link on the bottom of a reply notification email.