Mobile Tech
1.14K subscribers
91 photos
8 videos
6 files
138 links
Michael Lazebny's blog about @dart and @flutter
lazebny.io
Download Telegram
By the way, just a reminder:

You still can use material 2

Just set useMaterial3 to false…
😁7👍4🤡2
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
👍11
In the process of writing an article about tips, discovered this gem :D

#funny
😁8🤯2👀21🤡1
“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
👍6
coming tomorrow!
🥰8👍6🔥2
Absolute record today ❤️
🔥116
🤩🤩🤩 100 STARS on Sizzle Starter !
Please open Telegram to view this post
VIEW IN TELEGRAM
11🔥10💩3🤩2👏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.
🔥3👍2
Does each setState causes repaint?
Anonymous Quiz
43%
Yes
57%
No
😁14
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/
😢9🤯4
Five Questions for Middle Flutter Developer

How will you adapt UI to large/small screens?

Ephemeral vs app state.

How do you implement state management?

Tell about “Constraints go down, sizes go up”.

How will you communicate with Native platforms?

#flutter #tip
👍13
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.
🔥16🥰32
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!
10🔥3
https://joebubna.github.io/Cora/documentation/v2/dependency-injection/overview/

Good article about Dependency Injection and Service Locator
👍82