Whatβs stopping you from coding like this?
Whatβs stopping you from coding like this?
Do you have a 'before vs after' example or a playground project?
It would be great to visualize how the build scope shrinks with this pattern compared to the traditional cascading rebuilds
Ah, I see. Using enums as const tokens keeps the widget tree structure immutable, while the context resolves the actual value only at the leaf nodes.
It aligns perfectly with the Strategy concept: separating the const token from the runtime resolution. It sounds like a robust optimization
Interesting take on Figma tokens β const fields.
But how does this handle runtime theming (Dark/Light/Custom)? Wouldn't swapping the active constant set still force a full tree rebuild, or is there a specific pattern to optimize that?
Looks clean on mobile too!
Sometimes we get obsessed with learning the latest framework features and forget that fundamental Software Engineering concepts (like Design Patterns) run the show under the hood.
Understanding the pattern = Understanding the tool. π οΈ
#FlutterDev #SoftwareEngineering #Dart #DesignPatterns
This explains exactly why Widgets must be final and immutable.
In the Strategy Pattern, you often don't mutate the active strategy; you simply replace it with a new one to change behavior.
Flutter does exactly this: it swaps the Strategy (Widget) to update the UI state.
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."
If we map this directly to Flutter's internal architecture, it fits perfectly:
1οΈβ£ The Context: It represents the Element (accessed via BuildContext). It persists in the tree.
2οΈβ£ The Strategy: It represents the Widget. It is the immutable configuration of "how" something should behave or look.
I was reading the definition of "Context" in the Strategy Pattern and found this:
"The context isnβt responsible for selecting an appropriate algorithm... the client passes the desired strategy to the context. In fact, the context doesnβt know much about strategies."
Sound familiar? π€
π€― 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. π§΅π
All the logic is encapsulated within the Rive State Machine.
The frontend code stays clean, it simply passes numeric input trigger "Rooms" to drive the transitions and State Machine handle the rest.
No complex animation code required in the app.
Micro-interactions turn boring forms into memorable experiences π β¨
I designed this interactive bedroom counter using @rive.app
The goal: give immediate visual feedback on the property's scale, rather than just showing a number.
Buttery smooth and production-ready.
El ocio sin retorno de inversiΓ³n es el ΓΊnico ocio verdadero.
Deseo que hogaΓ±o se cumplan todas las metas que no se cumplieron antaΓ±o π¦Ύ
Visualizing how a product will look in your home at different times of day completely transforms the shopping experience.
π ->π‘
A short demo of how we can use AI to transform the lighting and mood in the Frescomax app.
What do you think of the visual result?
Deseo que hogaΓ±o se cumplan todas las metas que no se cumplieron antaΓ±o π¦Ύ
This is fun
On the other hand, if itβs scarce, the rod will be shorter, making it far easier to tip and leaving our balance in life much more fragile.
This is where I begin to reflect on the role money plays in this analogy, and the best fit I see for money is that it determines the size of our rod. If we have a lot of money, the rod will be longer, and as a result, it will be harder for things beyond our control to disturb our balance.
Many times, we donβt even place these weights ourselves; most of the time, Iβd dare say, they are weights beyond our control. Sometimes it rains, and the small drops cause the rod to wobble; other times, the wind blows hard and disturbs that delicate balance that keeps our life in order.
Certainly, the balance depends on what we place on the rod; sometimes it will sway or teeter more to one side than the other, making our life a bit more unstable, butβ¦ thatβs just how it is! Life fluctuates and is constantly changing, like the weights we place on each side of the rod.
Many people believe that money is everything and brings happiness, and I often imagine it metaphorically as if the balance of life were a rod with a support point right at its center of mass.
I usually see life as a series of elements that need to be balanced to achieve a certain harmony, making life more like a serene and manageable journey.
Yo creo que antes de que se acabe este aΓ±o algo debe caer, posiblemente el 2do trΓ‘iler este cerca
Muy bueno! Peroβ¦ como es posible que no tengas a BlueSky aquΓ todavΓa!? π
youβre using, and the code suggestions are well-written, utilizing the specific library. If you need to run a command, like in Riverpod, it suggests it, and you just have to execute itβit takes care of the rest.
Iβve been using Windsurf for a week now, and itβs pretty impressive how autonomous it is and how well it performs with the same language models as Cursor. Itβs very noticeableβever since I started using it, I havenβt looked back. Another great feature is that it detects the packages or libraries
something specific, you must first undergo that βmetamorphosisβ into the being or state that enables the creation of what you want to accomplish.
One of my favorite quotes by Nietzsche is:
βHe who has much to proclaim one day, stays silently much immersed within himself: he who has to kindle the lightning one day, must for a long time--be a cloud.β
I like it so much because I see it reflected in almost everything. When you want to achieve