© Rap Payne 2019
R. PayneBeginning App Development with Flutterhttps://doi.org/10.1007/978-1-4842-5181-2_9

9. Managing State

Rap Payne1 
(1)
Dallas, TX, USA
 

We kind of telegraphed this topic since the first chapter because we’ve been writing classes that extend a StatelessWidget. Now if Flutter has a StatelessWidget, then you’d think it also has a StatefulWidget. And you’d be right.

But what exactly is a StatefulWidget? How does it differ from a stateless one? When do we choose one vs. the other? What is the structure of a StatefulWidget? Are there rules for using one? If the data changes, how do you re-render it? Good questions, right? Well, be patient young Jedi and we’ll answer all of those and more in this chapter.

What is state?

State is widget ...

Get Beginning App Development with Flutter: Create Cross-Platform Mobile Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.