Mobile Tech
Don't use SVGs for Icons in Flutter. There are better and more performant ways. Rendering SVG requires several time-consuming operations: reading from memory, parsing the SVG to a binary format, parsing the binary format to Dart structures, and only thenβ¦
I have created SVG vs Iconfont Performance Benchmark
It tracks the rasterization, which is the process of rendering UI objects as pixels on the screen.
The icon font is much better on the GPU thread. SVG's complexity leads to expensive rasterization, which easily overwhelms the GPU and causes stutters.
You can check the full benchmark here https://github.com/hawkkiller/svg_iconfont_benchmark
Note that I tested on my MacBook, which is extremely performant. Testing on a low-end Android device may provide even more insights.
I also tried to add some readmes for better understanding.
#flutter #flutterdev
It tracks the rasterization, which is the process of rendering UI objects as pixels on the screen.
The icon font is much better on the GPU thread. SVG's complexity leads to expensive rasterization, which easily overwhelms the GPU and causes stutters.
You can check the full benchmark here https://github.com/hawkkiller/svg_iconfont_benchmark
Note that I tested on my MacBook, which is extremely performant. Testing on a low-end Android device may provide even more insights.
I also tried to add some readmes for better understanding.
#flutter #flutterdev
π₯9π5
There is an easy way to speed up Flutter tests in CI.
If you have a large test suite, use sharding. It distributes the number of tests between multiple shards, so you can create multiple parallel jobs in CI.
#flutter #FlutterDev
If you have a large test suite, use sharding. It distributes the number of tests between multiple shards, so you can create multiple parallel jobs in CI.
#flutter #FlutterDev
π8π1
Do not hardcode paths to assets; use the path generator!
The generator ensures that assets exist and removes the possibility of a typo.
Explore what fits your needs, but I would recommend flutter_gen/spider.
#flutter #flutterdev
The generator ensures that assets exist and removes the possibility of a typo.
Explore what fits your needs, but I would recommend flutter_gen/spider.
#flutter #flutterdev
π8β€5
It is better to wait before updating Flutter to the latest stable version.
After a new stable, there are usually multiple fixes published β 3.32 had 8 patches!
I recommend staying 1 stable version behind the latest release. This ensures that you won't be affected by regressions and new bugs.
#flutter #flutterdev
After a new stable, there are usually multiple fixes published β 3.32 had 8 patches!
I recommend staying 1 stable version behind the latest release. This ensures that you won't be affected by regressions and new bugs.
#flutter #flutterdev
π16
Is your layout ready for RTL languages?
A common mistake is using a fixed left/right EdgeInsets or Alignment.
Instead, use their directional counterparts. They provide logical start and end properties, allowing the UI to adapt automatically.
#flutter #flutterdev
A common mistake is using a fixed left/right EdgeInsets or Alignment.
Instead, use their directional counterparts. They provide logical start and end properties, allowing the UI to adapt automatically.
#flutter #flutterdev
π12β€2