Results 10 comments of Cristian Cosneanu

Same issue, The completion block is never called.

@martipello i have the same issue, this needs more attention.

@yhbsh yes, hence the "add the .env" into your `pubspec.yml` step. This approach is flawed in its core, sadly. ```yml assets: - .env ```

@yhbsh agree. I found this package [envied](https://pub.dev/packages/envied) it uses the `build_runner` to take the `.env` contents and bake them into a generated file. I added the `.env` and `.g.dart` files...

@yhbsh I haven't tried, i read it in [this article](https://codewithandrea.com/articles/flutter-api-keys-dart-define-env-files/#compiling-and-running-the-app-with---dart-define) > The main advantage of using --dart-define is that we're no longer hardcoding sensitive keys in the source code. >...

@yhbsh it is not easy, with obfuscation it is even harder. But still theoretically possible.

> Why not simply use `--dart-define-from-file=.env`? I don't quite understand the point of third-party packages here. > > You can never completely prevent users from being able to read the...

> They are defined in advance at compile time That's wrong. You can build you app without `--dart-define` flags and it will produce a valid build, with empty strings.

> [this comment](https://github.com/java-james/flutter_dotenv/issues/100#issuecomment-2165392205) > With --dart-define you will know about a missing env var at Runtime, with String.fromEnvironment. @maeddin again, with `--dart-define` you will know about a missing env only...