flutter_dotenv
flutter_dotenv copied to clipboard
How to add env variables in the command line
Hello, I am trying to set the variables in the command line
I am running
flutter run -d chrome
How do I add the env variables to the command?
any news?
I stumbled upon this myself, but later discovered that Flutter or Dart has built-in command that loads environment variable values:
flutter run --dart-define=baseUrl=https://github.com/
or file:
flutter run --dart-define-from-file=.env
Please see: https://itnext.io/secure-your-flutter-project-the-right-way-to-set-environment-variables-with-compile-time-variables-67c3163ff9f4