loadDartDefines static method
Seeds --dart-define compile-time constants into the runtime environment map.
Because String.fromEnvironment and bool.hasEnvironment are const constructors in Dart,
keys must be declared as compile-time string literals at the call site.
By default, overwrite is false so runtime .env values or dynamic maps take precedence.
BloomEnv.loadDartDefines({
if (const bool.hasEnvironment('API_BASE_URL'))
'API_BASE_URL': const String.fromEnvironment('API_BASE_URL'),
if (const bool.hasEnvironment('APP_ENV'))
'APP_ENV': const String.fromEnvironment('APP_ENV'),
});
Implementation
static void loadDartDefines(Map<String, String> defines,
{bool overwrite = false}) =>
loadMap(defines, overwrite: overwrite);