When to use InheritedModel in Flutter?
Inherited widgets are a powerful, natural way to propagate information down the tree in Flutter.
The crucial thing is that they are O(1). It means, that the time needed to obtain an inherited widget from the tree is equivalent to constant.
When InheritedWidget changes (i.e., some data is updated), dependent elements are notified via didChangeDependencies and eventually rebuilt.
However, when clients (modules that depend on a widget) are interested only in a certain part of its data things become a bit complicated as the inherited widget doesn’t support it.
In such a case, the Inherited Model comes to our help. Basically, they extend the functionality of InheritedWidget by adding an aspect field.
Clients declare the aspect they’re interested in and are notified only if the data they’re interested in changes!
I’ve enclosed an example of an inherited model used for settings. Basically, when the client is interested in the locale -> it will be notified if the locale changes.
There is also a widget called MediaQuery that’s probably used by every #Flutter application. It also implements InheritedModel with its brightnessOf, sizeOf, and others.
LinkedIn
Inherited widgets are a powerful, natural way to propagate information down the tree in Flutter.
The crucial thing is that they are O(1). It means, that the time needed to obtain an inherited widget from the tree is equivalent to constant.
When InheritedWidget changes (i.e., some data is updated), dependent elements are notified via didChangeDependencies and eventually rebuilt.
However, when clients (modules that depend on a widget) are interested only in a certain part of its data things become a bit complicated as the inherited widget doesn’t support it.
In such a case, the Inherited Model comes to our help. Basically, they extend the functionality of InheritedWidget by adding an aspect field.
Clients declare the aspect they’re interested in and are notified only if the data they’re interested in changes!
I’ve enclosed an example of an inherited model used for settings. Basically, when the client is interested in the locale -> it will be notified if the locale changes.
There is also a widget called MediaQuery that’s probably used by every #Flutter application. It also implements InheritedModel with its brightnessOf, sizeOf, and others.
Linkedin
When to use InheritedModel in Flutter? | Michael Lazebny
When to use InheritedModel in Flutter?
Inherited widgets are a powerful, natural way to propagate information down the tree in Flutter.
The crucial thing is that they are O(1). It means, that the time needed to obtain an inherited widget from the tree is…
Inherited widgets are a powerful, natural way to propagate information down the tree in Flutter.
The crucial thing is that they are O(1). It means, that the time needed to obtain an inherited widget from the tree is…
👍11
“Design first, code next”
In the rush to ship features faster, we often miss a valuable stage: planning.
At first glance, the components, modules, architecture, and work front may seem like something we'll figure out along the way. To be fair, that’s what happens. However, understanding often comes to us after repeated attempts to rewrite the code.
This approach also has additional problems. If you don't have the whole picture in front of you, like a diagram, you're more likely to miss some details, or just make it worse and harder to maintain.
On the other hand, if you had a diagram, it would be much easier to get other developers on board.
Imagine workers trying to construct a building without architectural drawings or any plans. It is obvious that they won't get anywhere.
Finally, I'd like to emphasize that the value of design is underestimated. Don't fall into this trap and always do at least the basics.
LinkedIn
In the rush to ship features faster, we often miss a valuable stage: planning.
At first glance, the components, modules, architecture, and work front may seem like something we'll figure out along the way. To be fair, that’s what happens. However, understanding often comes to us after repeated attempts to rewrite the code.
This approach also has additional problems. If you don't have the whole picture in front of you, like a diagram, you're more likely to miss some details, or just make it worse and harder to maintain.
On the other hand, if you had a diagram, it would be much easier to get other developers on board.
Imagine workers trying to construct a building without architectural drawings or any plans. It is obvious that they won't get anywhere.
Finally, I'd like to emphasize that the value of design is underestimated. Don't fall into this trap and always do at least the basics.
Linkedin
Michael Lazebny on LinkedIn: “Design first, code next”
In the rush to ship features faster, we often…
In the rush to ship features faster, we often…
“Design first, code next”
In the rush to ship features faster, we often miss a valuable stage: planning.
At first glance, the components, modules…
In the rush to ship features faster, we often miss a valuable stage: planning.
At first glance, the components, modules…
👍6
Please open Telegram to view this post
VIEW IN TELEGRAM
❤11🔥10💩3🤩2👏1
Site about android development has cool articles about architecture
https://developer.android.com/topic/architecture/intro
https://developer.android.com/topic/architecture/intro
Android Developers
App architecture | Android Developers
App architecture design is an important consideration for ensuring that your apps are robust, testable, and maintainable. Android provides a set of libraries and components to help you put together your app according to best practices.
👍7🔥1
How does #Flutter draw a frame?
The process can be initiated by several sources - setState, render object, system, or engine.
When you call setState, it marks the element as dirty and asks the engine (C++) for a frame via FFI. Later, when the engine is ready, it calls the WidgetsBinding.drawFrame callback.
The drawFrame iterates through the element tree and rebuilds dirty elements. If dirty elements change their size, color, or orientation (generally something that render objects are interested in) - render objects are marked as dirty.
Then the framework performs layout and painting.
Finally, the scene (or frame) is built and sent to the painting engine.
The process can be initiated by several sources - setState, render object, system, or engine.
When you call setState, it marks the element as dirty and asks the engine (C++) for a frame via FFI. Later, when the engine is ready, it calls the WidgetsBinding.drawFrame callback.
The drawFrame iterates through the element tree and rebuilds dirty elements. If dirty elements change their size, color, or orientation (generally something that render objects are interested in) - render objects are marked as dirty.
Then the framework performs layout and painting.
Finally, the scene (or frame) is built and sent to the painting engine.
🔥3👍2
Ian Hickson left Google.
Lead that worked on flutter last 11 years.
That’s not a good sign for Google, especially for their techniques in managing projects.
https://ln.hixie.ch/
Lead that worked on flutter last 11 years.
That’s not a good sign for Google, especially for their techniques in managing projects.
https://ln.hixie.ch/
😢9🤯4
I am planning on doing a live broadcast on YouTube this Saturday or Sunday. What’s the most convenient time for you?
Anonymous Poll
19%
Morning (9-11)
25%
Day (13-16)
77%
Evening (16-19)
I will start my side project that involves creating custom backend and cross platform app.
I will tell about the idea and features.
Then, we will design authentication & authorization.
Technologies: Go, Flutter, Kubernetes.
I will tell about the idea and features.
Then, we will design authentication & authorization.
Technologies: Go, Flutter, Kubernetes.
🔥16🥰3❤2
Mobile Tech
Started :) https://www.youtube.com/watch?v=gYHgreP2mGQ
Huge thanks to everybody who was there :)
Next time we will start writing #golang code.
Focusing more on preparing, being concise and structured!
Next time we will start writing #golang code.
Focusing more on preparing, being concise and structured!
❤10🔥3
https://joebubna.github.io/Cora/documentation/v2/dependency-injection/overview/
Good article about Dependency Injection and Service Locator
Good article about Dependency Injection and Service Locator
👍8❤2