Skip to content

Conversation

@vishwamartur
Copy link

Related to #1

Update the environment variable for authKey and add documentation for setting up the .env file.

  • lib/env/env.dart

    • Update the @EnviedField annotation to use varName: 'AUTH_KEY' instead of varName: 'AUTH-KEY'.
  • .gitignore

    • Remove the .env entry from the ignore list.
  • .env

    • Add a new .env file with the content AUTH_KEY=your_auth_key_here.
  • README.md

    • Add a section to document the need for a .env file and the required AUTH_KEY variable.
    • Include instructions for running the project after setting up the .env file.

Related to code100x#1

Update the environment variable for `authKey` and add documentation for setting up the `.env` file.

* **lib/env/env.dart**
  - Update the `@EnviedField` annotation to use `varName: 'AUTH_KEY'` instead of `varName: 'AUTH-KEY'`.

* **.gitignore**
  - Remove the `.env` entry from the ignore list.

* **.env**
  - Add a new `.env` file with the content `AUTH_KEY=your_auth_key_here`.

* **README.md**
  - Add a section to document the need for a `.env` file and the required `AUTH_KEY` variable.
  - Include instructions for running the project after setting up the `.env` file.
@mrcodefrost
Copy link

Hi @vishwamartur , this is working thanks, i was able to generate the .env.g.dart but

  1. Where can i get the auth key ? @vishwamartur @harsimran-d

Note : In case same error is popping up after this change then refer to below solution

  1. Issue : Flutter was unable to detect the .env in root folder. ( root file is the one where your pubspec.yaml resides in hierarchy)
    Solution :
    I refactored it to secrets.env,
    ran the build_runner, it then ran successfully.
    Refactored it back to .env and deleted old g files and ran the build_runner again.

Worked perfectly this way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants