This week I have been busy integrating GitLab's code quality features in the Flutter projects I am working on. We do not use CodeClimate, and it does not seem to support Dart anyway, so I had to look into other solutions.
Dart Code Metrics analyzes and reports your code quality. You can set the report to be in a format that GitLab understands. So I added the package as a development dependency and I created a GitLab CI job for it. Now we get the report directly in the merge request UI. Useful as a pre code review step.
The only problem I have is that there is not a 1 to 1 map between the rules in this package and the static analysis tool Dart is shipped with. Dart Code Metrics is maintained by Dmitry Zhifarsky and others.
Do you have any suggestions from your experience with this package?
Let me know in the comment section.
- Michele Volpato
This week, Dhruv Nakum explains how to add interceptors to your Flutter networking code, using the Dio package. Interceptors are useful when you need to perform some action to all networking calls your app makes. For instance a specific header.
I use Firebase Distribution to reach testers and users outside of my team for builds that we do not want to distribute using Android Beta or Apple TestFlight.
Giovani Albuquerque, instead, uses a Dart program he wrote that distribute an app via Telegram. That is an interesting approach.
Sometimes we are so busy using state management packages that we forget that Flutter has already everything we need to handle state. This article, by Erlend, reminds you exactly this. You don't have to avoid external packages entirely, but read the article and see how simple it can be. If I could add anything to it, it would be the usage of
InheritedWidget instead of a global variable.
Graphic is a flutter package that implements Leland Wilkinson's book The Grammar of Graphics, which defines data visualization in terms of scales and layers. In this tutorial, LIN Chen shows us how to use it.
Read the rest on my website.
Join the Flutter and Dart newsletter and receive it weekly in your inbox.