AnitPatterns Of State

Fred Grott
5 min readAug 20, 2021

Want to ace that job interview? Let’s gear up for an interesting story. The story of you controlling your Flutter App State!

The Knuth Problems

he Knuth problems are obviously the challenge of steering away from o(n) to o(1) computations in data structures. o(n) is real bad as it’s a growing in time bottleneck.

The second problem is a kissing-cousin to the first one in that rather than trying to avoid infinite loops(o(n)), we want to avoid a graph situation where we have two paths to the same parent node.

It does not matter whether the nodes in the graph are ordered or not on the path, we still want to avoid a graph where we have more than one path(edge) to the nodes in full.

How does Reactive fit into this story?

Reactive And State

Now, let me ask a question. What is the core feature of Reactive?

Most would claim that the immutability of functions is the core feature of Reactive. The problem is that OOP with classes is not immutable. How does Flutter fake immutability?

Flutter’s Simulation of Immutability

The default Flutter Counter app:

--

--