Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Latest commit

 

History

History
executable file
·
159 lines (111 loc) · 3.93 KB

File metadata and controls

executable file
·
159 lines (111 loc) · 3.93 KB

Working with environment variables flutter By Codefarmer

In this video, we will see how to setup and use environment variables with Flutter. We will not be using any package to handle this.


(back to top)


Resources

Working with environment variables flutter By Codefarmer


(back to top)


Usage

  • Load environment variables from file.

    flutter run --dart-define-from-file=lib/config/config.json
    
  • Setup VSCode Debugger to autoload the env file. add toolArgs parameters --dart-define-from-file PATH/TO/ENV/FILE to launch.json file.

    {
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      "version": "0.2.0",
      "configurations": [
        {
          "name": "development",
          "request": "launch",
          "type": "dart",
          "toolArgs": [
            "--dart-define-from-file",
            "lib/env/development.env"
          ]
        },
        {
          "name": "production",
          "request": "launch",
          "type": "dart",
          "flutterMode": "release",
          "toolArgs": [
            "--dart-define-from-file",
            "lib/env/production.env"
          ]
        },
        {
          "name": "working_with_environment_variables_flutter (profile mode)",
          "request": "launch",
          "type": "dart",
          "flutterMode": "profile"
        },
        {
          "name": "working_with_environment_variables_flutter (release mode)",
          "request": "launch",
          "type": "dart",
          "flutterMode": "release"
        }
      ]
    }
    

(back to top)


Credits 💕


(back to top)


Get Involved ✨

Get in touch with the project developers and the community through our GitHub Discussions forum. View contributing.md for information.


(back to top)


Issues 🔥

Bug reports and feature requests can be submitted on the Github Issues.


(back to top)


Code of Conduct 👍

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Code of Conduct.


(back to top)


License ⚖️

This work is distributed under the Do What The F*ck You Want To Public License License. See license for more information.

Permissions

  • ✅ Commercial use
  • ✅ Distribution
  • ✅ Modification
  • Patent use
  • ✅ Private use

Conditions

  • Disclose source
  • License and copyright notice
  • Network use is distribution
  • Same license
  • State changes

Limitations

  • ❌ Liability
  • Trademark use
  • ❌ Warranty

(back to top)


Copyright ©️ ❤️


(back to top)