Mobile Tech
1.17K subscribers
92 photos
8 videos
6 files
140 links
Michael Lazebny's blog about @dart and @flutter
lazebny.io
Download Telegram
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
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
Enhancing Image Rendering Efficiency

Handling large images often leads to excessive consumption of device memory. To tackle this issue, DevTools offers valuable insights into identifying images that are too large.

To optimize, consider setting 'cacheWidth' or 'cacheHeight' properties on your images. This approach decodes and stores images in memory at a designated size.

There is also a ResizeImage class in the SDK that can be used to resize the image.

See how the GSkinner team utilized AppImage in the Wonderous project, offering a real-world example of these techniques in action - https://buff.ly/46sE71y

#FlutterDev #Flutter #Performance
πŸ‘9
Media is too big
VIEW IN TELEGRAM
Use extent to optimize scrolling

If all elements have the same length along their main axis, it is recommended to set the extent or utilize prototypeItem. This will prevent the scrolling engine from laying out these widgets.

#Flutter #Performance
πŸ‘8πŸ”₯4
formsf.png
648 KB
Implemented extremely simple forms for #Flutter that support asynchronous validators πŸ‘€
πŸ‘7πŸ”₯4
Screen Recording 2024-05-18 at 20.43.37.mov
3.3 MB
πŸ”₯ A new article about popups is coming next week!

In the meantime, I have created a custom popup that positions follower widget relatively to a target and prevents it from overflowing the screen.

#flutter
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯11πŸ‘3
Avoid these dart libraries. Briefly about their drawbacks and better alternatives.
https://lazebny.io/avoid-these-dart-libraries/

#flutter #flutterdev #dart
πŸ‘15πŸ”₯6πŸ€”4πŸ‘2πŸ‘Œ1πŸ’―1
Tomorrow, I'm launching a new article series on creating UI Kits.

I’ll guide you through developing various components like buttons, text fields, and more.

You’ll also learn about animations, transitions, iconography, responsive design tools, and best practices for layouts and custom components.

#article #uikit #flutter
7❀22πŸ‘7πŸ”₯7
Learn how to build efficient sticky headers in Flutter using slivers for seamless scrolling. Includes code examples and best practices!

https://lazebny.io/sticky-headers

#flutter #article
πŸ‘9πŸ”₯3
Learn how scroll works in Flutter, the differences between scroll widgets, and how to build efficient layouts using slivers for best performance.

https://lazebny.io/flutter-slivers

#article #flutter #slivers
πŸ”₯8❀2πŸ‘Ž1
I created a simple but much more powerful alternative to Widgetbook, Storybook, and similar tools.

It automatically generates routes for GoRouter (supports deep links).

It also makes it very easy to create configurations, fields, etc., for customizing widgets.

This is just an exampleβ€”it will be improved over time and might eventually be added to sizzle starter or a separate package.

Github Link

#flutter
πŸ‘11πŸ₯°4πŸ”₯3❀1
This media is not supported in your browser
VIEW IN TELEGRAM
Created a minimal example of custom AppBars using SliverPersistentHeaderDelegate.Take a look here https://github.com/hawkkiller/pageheader/blob/main/lib/page_header.dart

#flutter #flutterdev
πŸ‘13❀‍πŸ”₯2πŸ”₯2
If you want to make your VS Code indentation a bit more beautiful for #Flutter widgets, set "dart.previewFlutterUiGuides" to true

If I'm not mistaken, the same thing exists in IDEA :)
❀11πŸ‘4