Is it possible to read the value as constant?
I am reading the values from .env file and I am following the example. I would like to have the option to do this:
static const String apiUrl = env['base_url'];
Because I am using this for retrofit and it requires base_url to be a constant value. This is not possible right now.
This isn't possible currently since the .env file is read and the env map is generated only at runtime.
I think a simple solution would be to use flutter run --dart-define=base_url=https://www.google.com and retrieve the variable using const String.fromEnvironment('base_url')
i need to read as constant too.
Please, I am having this same issue. Any solution for this?