This week inFlutter #42
Tags: flutter, dart, news
Published: 2022-02-20 15:34:09

This week I have been busy integrating [GitLab's code quality](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html) 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](https://dartcodemetrics.dev) **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](https://twitter.com/_incendial) and others.

Do you have any suggestions from your experience with this package?
Let me know in the [comment](https://ishouldgotosleep.com/news/this-week-in-flutter-42/#comments) section.

<small>- Michele Volpato</small>

## Development 🧑‍💻

### 🔗 [Networking In Flutter: 🔥Interceptors🔥](https://dhruvnakum.xyz/networking-in-flutter-interceptors)

This week, [Dhruv Nakum](https://twitter.com/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.

### 🔗 [Send APK automatically to Telegram using Dart/Flutter](https://gavs2.medium.com/telegram-bot-to-send-apk-automatically-using-flutter-dart-34931afb426)

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](https://github.com/Giovaniavs), instead, uses a Dart program he wrote that distribute an app via **Telegram**. That is an interesting approach.

### 🔗 [Pragmatic State Handling in Flutter](https://betterprogramming.pub/pragmatic-state-handling-in-flutter-d8c9bf5d7d2)

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](https://twitter.com/apptakk), 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.

### 🔗 [The Grammar of Graphics in Flutter Charts](https://dev.to/entronad/the-grammar-of-graphics-in-flutter-charts-3fhj)

[Graphic](https://github.com/entronad/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](https://github.com/entronad) shows us how to use it.

---

[...]

Read the rest on [my website](https://ishouldgotosleep.com/news/this-week-in-flutter-42/).

[Join the Flutter and Dart newsletter](https://ishouldgotosleep.com/subscribe-to-the-newsletter-devto/) and receive it weekly in your inbox.