🤯 Just had a massive Eureka moment revisiting Design Patterns. We often treat #Flutter’s BuildContext as some sort of "magic" variable, but while reading about the Strategy Pattern on refactoring.guru today, everything just clicked. Flutter applies this pattern beautifully. 🧵👇
Post
The Element (Context) acts as a generic container, it doesn't know how to paint or layout on its own. In every build() method, we (the Client) pass a NEW "Strategy" (a new Widget) to the Context. "Here Element, this is your new configuration. Run it."
0 reposts0 likes