Flavoring Flutter

Salvatore Giordano
5 min readApr 27, 2018

If you read my last Flutter story you know that we had a problem configuring flavors in Flutter.

Why to use flavors

Working alone as a hobbyist android developer I never looked at flavors/build-config.
I did not need them, I was the only person of my team and the only stakeholder ¯\(ツ)

Here at Iakta the team is bigger and we have many customers, so if something goes wrong you cannot just yell at the mirror.

Flavors are just comfortable. They let you define some build configuration and switch them as you want. For example you could have one flavor for development, and one for production. You can set different url for api calls or different icons and app names. With a click you’re ready to develop or to release your great application.

We use a lot flavor configurations, not only for comfort, but also to be sure to deploy the right version of the app. We just set different icons and sometimes even app theme to be sure not to release an app with an api url pointing to local or staging machines. That would be very dangerous and shameful.

Me ashamed

--

--

Salvatore Giordano

💻 Flutter developer @ GetStream • Software engineering student @ PoliTo • Technology enthusiast • https://imtoori.dev/