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
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
Imperative Paradigm is about
Anonymous Quiz
37%
What to achieve
63%
How to achieve
πŸ‘4
Do not use Future.wait in Dart!

When dealing with multiple futures simultaneously, it is important to put them all into an event loop. A common approach is to use Future.wait, but it has drawbacks:

- If a future fails, the returned future will complete with an error and waste time executing other futures (unless eagerError is set).

- You can't handle events and errors individually.

- Type information is lost.

A better alternative is to use streams, which allow you to process futures individually and handle errors without interrupting execution or losing data.

If you need ordered data, consider using an await-based approach, as shown. This allows for concurrent processing of each future while preserving types and error handling.

There is also a new wait API provided by Records, but there is no eagerError equivalent, so streams and standard futures remain the recommended solution for concurrent, robust future processing.
πŸ”₯13πŸ‘5πŸ€”3πŸ‘Ž1πŸ‘Ύ1
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
Does the world need an article about BLoC?
Anonymous Poll
78%
Yes
22%
No
πŸ”₯8πŸ‘1
Added database section to sizzle starter template documentation!

https://sizzle.lazebny.io/storage/database/about/
πŸ‘13
Some interesting (and hard) questions:

- How does setState result in a new frame?
- What's the rendering pipeline?
- How does repaint boundary work?
- How to implement offline-first?
- What is declarative navigation?
- How do you initialize dependencies?
πŸ‘8
Working on small, but interesting article about overlays and popups.

It will be about OverlayPortal, OverlayController and other widgets to make alignment & positioning ease.

inspired by this one: https://plugfox.dev/layer-link/
πŸ‘8πŸ”₯5
Mobile Tech
Tomorrow we will build something interesting! Hope to see you there. https://www.youtube.com/watch?v=blJzdukYZwg
Guys, I’d like to ask you for some feedback or suggestions!

What you liked on streams and what you didn’t.

Or maybe, you have some ideas
πŸ‘Œ5
Popups in Flutter the right way!

I'm asking for some feedback - Do you find this article of your interest, is it written in clear language? Thanks!

https://lazebny.io/popups-in-flutter/
πŸ‘11
Next article will be about exceptions.

- how to handle them correctly
- backend errors
- stacktrace / throwing / rethrowing
- comparison to either
πŸ”₯24πŸ‘9
πŸŽ‰
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸŽ‰24πŸ₯°8πŸ‘5🍾3❀1πŸ‘1πŸŽ„1
I've recently discovered a cool free font named "Satoshi"
πŸ‘11❀2
πŸ‘14