Use object env values in Flutter

70 Views Asked by At

I registered a Flutter app in Firebase and generated several files with values that I consider sensitive, such as the project_info (object) and client_info (object) in a JSON file and API_KEY in GoogleService-Info.plist files

In JavaScript, is there an option to use env object and array values:

SOME_VAR=VAL1,VAL2,VAL3

const someVar = process.env.SOME_VAR.split(",");
console.log(someVar); // [ 'VAL1', 'VAL2', 'VAL3' ]

Object:

OBJECT_VAL={ "VAR1": "VAL1", "VAR2": "VAL2", "VA31": "VAL3" }

const objectVal= JSON.parse(process.env.OBJECT_VAL);
console.log(objectVal); // { VAR1: 'VAL1', VAR2: 'VAL2', VA31: 'VAL3' }
0

There are 0 best solutions below