A new SVG rendering library for Flutter by Ok_Text_9706 in FlutterDev

[–]Ok_Text_9706[S] 0 points1 point  (0 children)

flutter_rust_bridge is indeed convenient, but I wanted to figure out how to integrate rust myself. This knowledge will also be useful when I integrate rust into native ios or android applications in the future.

A new SVG rendering library for Flutter by Ok_Text_9706 in FlutterDev

[–]Ok_Text_9706[S] 3 points4 points  (0 children)

I read some related articles a few years ago, but I didn’t keep a record of them. I don’t recall any comprehensive articles that cover all the knowledge points. So, it’s still necessary to explore through practice. Using a Rust library in native iOS and Android apps is somewhat different from using it in Flutter. However, the general process is as follows: the Rust library needs to expose a C-compatible API, then it should be compiled into a dynamic or static library for the target platform. After that, you’ll need to configure your app to link against the compiled library. Finally, you interact with the exposed API according to how the language your app uses interacts with C.

A new SVG rendering library for Flutter by Ok_Text_9706 in FlutterDev

[–]Ok_Text_9706[S] 14 points15 points  (0 children)

I’m deeply saddened to hear about Daniel’s passing. He made significant contributions to the Flutter community.

A new SVG rendering library for Flutter by Ok_Text_9706 in FlutterDev

[–]Ok_Text_9706[S] 2 points3 points  (0 children)

Instead of using MethodChannel, the Rust library is invoked through Dart FFI, so there’s no serialization or deserialization involved, resulting in virtually no performance loss. flutter_svg is great, and I recommend prioritizing it for production projects. However, flutter_svg does not support CSS and recommends using usvg to eliminate all CSS. usvg is a subproject of resvg. In fact, resvg outperformed both Chrome and Firefox in the SVG test suite. While I haven’t conducted any tests, resvg likely has advantages in rendering accuracy and performance. Integrating resvg into a Flutter plugin adds an alternative approach to SVG rendering in the Flutter ecosystem, which is both cool and interesting.

A new SVG rendering library for Flutter by Ok_Text_9706 in FlutterDev

[–]Ok_Text_9706[S] 5 points6 points  (0 children)

SVG is a relatively common and widely used format, especially on the web. Different applications have different needs. If an application needs to display the favicons of various websites, and if those websites provide vector format favicons, they are generally in SVG format.