Navigating StatefulWidgets Part 2

Greg Perry
15 min readMar 15, 2024

A continued look at Flutter’s StatefulWidget, its State and its Lifecycle.

I’ll continue where I left off in my previous article, Navigating StatefulWidgets Part 1, working with the gist, three_counter_app_with_prints and commenting out the list of return statements to demonstrate how both the StatefulWidget and its State object behave under certain circumstances in your typical Flutter app. With numerous print() methods in and among the code, we’ll get some good insight as to what event functions fire in the Flutter framework (from user or system interaction) and in what order.

I Like Screenshots. Tap Caption For Gists.

As always, I prefer using screenshots in my articles over gists to show concepts rather than just show code. I find them easier to work with frankly. However, you can click or tap on their captions to see the code in a gist or GitHub. Tap or click on the screenshots themselves to zoom in on them for a closer look. If reading on your phone, use two fingers to expand and collapse the image. Ironically, you may find it best to read this article about mobile development on your computer rather than on your phone.

No Moving Pictures, No Social Media

There will be gif files in this article demonstrating aspects of the topic at hand. However, it’s said viewing such gif files is not possible when reading this article on platforms like Instagram or Facebook. They may come out as static…

--

--