Prøve GULL - Gratis
Introduction to Flutter State Management
Circuit Cellar
|April 2025
As Bob continues this article series on Mobile App development from an Embedded System's perspective, he tackles State and State Management in Flutter. As you will see, it is very different from what embedded engineers are used to when we think of state and that misunderstanding can cause no end of trouble if we don't understand it.
Over the years, I found that designing embedded systems using state machines to be a useful and powerful paradigm. There are different methods of implementing a state machine (Complete code for these is found in the Resources for this article): a table of function pointers indexed by the state (see Figure 1 for a code snippet); the “switch-case” method (see Figure 2 for a code snippet); or when using an object oriented language like C++, you can encapsulate each state in a class to represent the state and it's transitions (see Figure 3).
However, my hubris in thinking I was well versed in state machines did not prepare me for understanding state in either React Native or Flutter. As you may remember, I had two major problems with React Native: how it managed concurrency; and how it managed state. No surprise here. The same thing happened with Flutter, so let's start defining terms and see if we can unravel the mystery of states and state management in Flutter.
Everything in Flutter is made up of Widgets. And there are two kinds of Widgets: State less widgets and Widgets that change based on the state of the User Interface (UI). These are called appropriately StatelessWidgets and StatefulWidgets respectively. But wait! What do they mean by state?
REACTIVE/DECLARATIVE VS IMPERATIVE UI
Denne historien er fra April 2025-utgaven av Circuit Cellar.
Abonner på Magzter GOLD for å få tilgang til tusenvis av kuraterte premiumhistorier og over 9000 magasiner og aviser.
Allerede abonnent? Logg på
FLERE HISTORIER FRA Circuit Cellar
Circuit Cellar
Alif Semiconductor Elevates Generative AI at the Edge with New Support for ExecuTorch Runtime in Its Ensemble MCUs
Alif Semiconductor, the leading global supplier of secure, connected, power efficient Artificial Intelligence and Machine Learning (AI/ML) microcontrollers (MCUs) and fusion processors, announced that developers can now use the ExecuTorch Runtime, a quantization extension of the popular PyTorch ML framework, for AI applications built to run on its Ensemble E4/E6/E8 series of MCUs and fusion processors.
1 min
December 2025
Circuit Cellar
Encrypted MQTT Protocol for Critical Sectors
Mechanisms, Challenges, and Best Practices
3 mins
December 2025
Circuit Cellar
Datasheet: Small Size, Big Power
Smaller Microcontrollers Bring New Possibilities
9 mins
December 2025
Circuit Cellar
Analog Devices Launches ADI Power Studio and New Web-Based Tools
Analog Devices, Inc. (ADI), a global semiconductor leader, announced the launch of ADI Power Studio, a comprehensive family of products that offers advanced modeling, component recommendations, and efficiency analysis with simulation.
1 mins
December 2025
Circuit Cellar
Compact IBR300 2.5" SBC Powered by NXP i.MX 93 from IBASE
IBASE Technology, Inc., a leading provider of rugged embedded computing platforms, announced the release of the IBR300, a 2.5\" RISC-based single board computer (SBC) powered by the NXP i.MX 93 processor with dualcore ARM Cortex-A55 (up to 1.7GHz) and a Cortex-M33 MCU.
1 min
December 2025
Circuit Cellar
Sensors in the Spotlight
The Next Decade of Embedded Sensor Systems
12 mins
December 2025
Circuit Cellar
Bob's Wrap Up
In Bob's last article with Circuit Cellar, he attempts to wrap up a career of more than 50 years as an embedded systems engineer and 14 years with Circuit Cellar. He looks at each of his 58 articles by category and provides some recommendations for his fellow engineers.
7 mins
December 2025
Circuit Cellar
Designing Embedded Software Architectures That Last
I've reviewed hundreds of firmware projects over the years, and one thing always stands out: the most successful projects have a clear, deliberate architecture.
10 mins
December 2025
Circuit Cellar
Broadcom Introduces Industry's First Wi-Fi 8 Silicon Ecosystem Powering the AI Era
Broadcom, Inc. unveiled the first Wi-Fi 8 silicon solutions for broadband wireless, targeting residential gateways, enterprise access points, and smart mobile clients.
1 mins
December 2025
Circuit Cellar
GD32 MCU Family Expands High-Performance Portfolio with New GD32F503/505 Series MCU
GigaDevice, a leading semiconductor company specializing in Flash memory, 32-bit microcontrollers (MCUs), sensors, and analog products, announced the official launch of the GD32F503/505 series of high-performance 32-bit MCUs, expanding its product range based on the ARM Cortex-M33 core.
1 mins
December 2025
Listen
Translate
Change font size
