DEV Community

Joao Pedro Gonçalves
Joao Pedro Gonçalves

Posted on

Managing Feature Flags with Unleash - Flutter - Setting Env Vars

Setting up Environment Variables(Env Vars) is a strategy to avoid exposing sensitive information. Usually we use a file name .env containning fields with sensitive information.

To not expose the data we put .env in the .gitignore. Pretty net right ?

Using the unleash package for Dart we need to pass two arguments: instanceId, unleashApi.

Like is done in this Unleash POC in Flutter Project

If you're using gitlab you can find this two informations in:

Your Project > Deployments > Feature Flags > Configure

Gitlab

Copy the fields values and put in the .env. One-liner below to easy your work:

printf "URL_API=<URL_API>\nINSTANCE_ID=<INSTANCE_ID>" > .env2   
Enter fullscreen mode Exit fullscreen mode

Sentry mobile image

Improving mobile performance, from slow screens to app start time

Based on our experience working with thousands of mobile developer teams, we developed a mobile monitoring maturity curve.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay