get function

dynamic get(
  1. String envName, {
  2. bool? withProduction,
})

Method to get an environment variable from the system

mandatory envName: String => Environment file name optional withProduction: bool => define if you want the variable inside the production env or in the development env

Implementation

dynamic get(String envName, {bool? withProduction}) {
  withProduction = Memory.production;
  if (withProduction)
    return Memory.memoryStorage
        .where((element) => element.name == envName)
        .single
        .content[Memory.production ? "production" : "development"];
  return Memory.memoryStorage
      .where((element) => element.name == envName)
      .single
      .content;
}