I'm using flutter_dotenv to manage some API keys - https://pub.dev/packages/flutter_dotenv
According to the instructions I should add the .env file to assets in pubspec.yaml but when I run flutter build web it adds the .env file to the build for deployment. This doesn't seem correct to me because the .env file should not get deployed anywhere publicly from what I understand.
I had the same issue, and solved it by renaming
.env.*files toenv.*.https://pub.dev/packages/flutter_dotenv#usage