I have read many post about env var using for web app. Some post said don’t use .env file, and some explain how to use .env to store the API key or senitive data for the app. And not much post using Flutter and Netllfy both.
I saw Neltify provide a env var setting with “import from a .env file”, but actually I have no idea how to apply Neltify env var on my flutter web app.
dotenv is a normal package to read .env file, it is work on local test. After deploy to netlify, it pop up a error, because there is no .env file existing on root or publish directory after deploy.
Is there is a correct way step by step to use " env var" on Netlify??
if [ -d "flutter" ]; then cd flutter && git pull && cd ..; else git clone https://github.com/flutter/flutter.git; fi; flutter/bin/flutter build web --dart-define=SOME_TEXT=$SOME_TEXT
but another issue come out, when the deploy is done, the api_key will be data breach when using F12 to inspect the webpage. That is why I keep try many method to hide the api_key, but still not work.
I have read the blog post, still have a question: I only can hide the api key using Netlify CLI?
The 1st step: creating new environment variables via Netlify UI, is already done.
2nd step: need install Netlify CLI, then use the command based on blog post
Please advise if my understanding is correct. Thanks again.