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

Top comments (0)