## Intro to Flutter: a practical guide to cross-platform development

Today I would like to share with you our experience with running our Flutter application in production for about 6 months. We will talk about how to organize your code, which libraries to use and other tips and tricks we’ve learned so far.

This is actually a text version of my online presentation – for those who (like me) prefer reading to watching and listening.

## Flutter for Web: is it a killer of React?

During one of our recent discussions about Flutter and Flutter for Web (and I do like talking about Flutter a lot), I was asked a question, whether the final goal of our Application Development department is to fire all the front-end developers and replace them with Flutter developers. It was a joke, of course, but I think it’s a good question to think about and to discuss: what role Flutter is going to play in Web development.

Let’s think about types of Web applications we usually develop.

## Flutter: how to draw text along an arc

For one of our side projects (highly experimental and written in Flutter for Web, by the way) I needed to implement something like this:

## Flutter: рисуем текст вдоль окружности

Понадобилось мне тут на днях в одном мини-проекте (проект, можно сказать, экспериментальный, сделан на Flutter Web) реализовать такого вида штуку:

## Mews Challenge

At the latest WebExpo conference we had a mini-game in our booth (or 2 mini-games to be precise – tests for designers and developers). The candidate selects one right answer per question and had only one attempt to pass the test. The ranking was done by the number of correct answers and by the time (in the case of a tie).

The designer test included 20 questions where you needed to select one of 2 images that presented "the right way" and "the wong way" from UX and UI points of view.

The developer test was more complicated. It consisted of 20 questions across all our technology stack with 4 options to choose from: C# for backend questions, JavaScript for frontend questions, Dart for mobile development, Python and SQL from Data department (if you're interested in our technology stack check out this repo).

## Dependency Injection in Flutter

As I wrote in a previous article, we’re experimenting with Flutter while developing our side project for step challenges with colleagues. This side project should also be considered as a playground, where we can check if we can use Flutter in more serious projects. That’s why we want to use some approaches there that can look like an over-engineering for such a small project.

So one of the first questions was what can we use for dependency injection. A quick search in the internet revealed 2 libraries with positive reviews: get_it and kiwi. As get_it turned out to be a Service Locator (and I’m not a fan of this pattern), I was going to play with kiwi, which looked more promising, but then I’ve found another one library: inject.dart. It is heavily inspired by Dagger library, and as we use the latest one in our other Android projects, I’ve decided to dig into it.

## Multi-platform apps: are we there yet?

The weekend was rather rainy, so I was playing with Flutter. Last time I’ve tried it, it was still in beta (or even alpha?), so I was interested if it finally became useful for building multi-platform apps.

I’ve decided to re-make our MileFarClub app (it’s our internal side project for tracking steps and competing with colleagues). Here’s what I was able to achieve while investing into it several hours for 2 days:

## О чем все-таки говорит developer.android.com про RecyclerView

На написание статьи меня подтолкнул этот пост (а точнее, то чувство резкого локального повышения температуры в районе... хм, поясницы, обычно возникающее, когда в интернете кто-то неправ).

Начнем с самого начала. Полностью согласен, что "между жизненным циклом активности и работой RecyclerView есть нечто общее" – это "нечто" – необходимость понимать, что мы делаем и зачем. И читать документацию. А невыполнение этих двух необходимостей, как и сон разума, рождает монстров. Только вот с тем, как предлагает с этими монстрами бороться предыдущий автор, я категорически не согласен.

## Создание диалога для выбора рингтона

Понадобилось мне тут для одного проекта сделать свой диалог с выбором рингтона в настройках. Сразу по 2 причинам – во-первых, в support library RingtonePreference отсутствует, так что использовать стандартный диалог в PreferenceFragmentCompat не получится. А во-вторых, мне надо было туда в дополнение к стандартным мелодиям добавить несколько звуков из ресурсов. Так что решено было написать свой диалог.