java-james / flutter_dotenv

Loads environment variables from `.env`.
https://pub.dartlang.org/packages/flutter_dotenv
MIT License
220 stars 47 forks source link

where does the .env file go? #88

Closed nyck33 closed 1 year ago

nyck33 commented 1 year ago

You need a tree diagram in your Readme so right away users know, "oh, that's where it goes".

nyck33 commented 1 year ago

This don't work

image

flutter:

The following line ensures that the Material Icons font is

included with your application, so that you can use the icons in

the material Icons class.

uses-material-design: true

To add assets to your application, add an assets section, like this:

assets:

zayKenyon commented 1 year ago

There's a couple changes you need to make in-order to get this to work.

  1. You need to place the .env file in the root of your project, see my image below:

image

  1. Your pubspec.yaml should read as follows. People commonly get the indentation of assets wrong here so pay attention to your file.
    flutter:
    uses-material-design: true
    assets:
    - .env
zayKenyon commented 1 year ago

If you're still having troubles, check out #72 .

nyck33 commented 1 year ago

Thanks!