java-james / flutter_dotenv

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

Updating key in .env file at runtime #30

Closed alokyadavmdt closed 2 years ago

alokyadavmdt commented 3 years ago

Is there a way that key in .env can be updated. I have a scenario where when app runs first time then the user enter the server info and that i need to save to env file so next time its not required.

As i checked i didnt find any method which can update the file at runtime

ngxingyu commented 3 years ago

There is no way to edit the .env file within the assets bundle. Perhaps you can copy the file to the applications directory and use that file as the .env file, or use another package such as shared_preferences to store the user input.

java-james commented 2 years ago

Closing due to question being answered. Can re open if a feature request or similar required