patrol icon indicating copy to clipboard operation
patrol copied to clipboard

Describe how to use `--dart-define-from-file`

Open pdenert opened this issue 1 year ago • 3 comments

Describe how to use --dart-define-from-file and add info how to use patrol.env in custom location using this option.

pdenert avatar Nov 18 '24 12:11 pdenert

Does simple --dart-define works for you?

kubicki-4human avatar Jan 07 '25 16:01 kubicki-4human

Yes --dart-define should work. If you have some trouble with using Patrol, join our discord (https://discord.gg/ukBK5t4EZg) and create new thread in #help-needed

pdenert avatar Jan 08 '25 16:01 pdenert

@pdenert

in my case I use

abstract class EnvProps {
  static const _myEnvVar = String.fromEnvironment("myEnvVar");
....
}

--dart-define-from-file=".env.json" and basically my file:

{ "myEnvVar":"someSecretValue" }

this is useful for passing apiUrl, some secret tokens that are being used for the build of the app itself

DmytroChuchmaiBarges avatar Jan 16 '25 11:01 DmytroChuchmaiBarges