Skip to content

Commit c211598

Browse files
committed
refactor: Simplify dart-define flag checks in EnvConfig class
- Streamlined the logic for checking --dart-define flags by removing unnecessary line breaks, enhancing code readability. - Ensured that checks for dart-define values remain exclusive to native platforms, maintaining compatibility with web environments.
1 parent ec14441 commit c211598

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

lib/core/config/env_config.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ class EnvConfig {
165165

166166
// Priority 2: Check --dart-define flags (native only)
167167
if (!kIsWeb) {
168-
final dartDefineValue = String.fromEnvironment(key);
169-
if (dartDefineValue.isNotEmpty) {
170-
return double.tryParse(dartDefineValue) ?? defaultValue;
171-
}
168+
final dartDefineValue = String.fromEnvironment(key);
169+
if (dartDefineValue.isNotEmpty) {
170+
return double.tryParse(dartDefineValue) ?? defaultValue;
171+
}
172172
}
173173

174174
// Priority 3: Return default value
@@ -192,9 +192,7 @@ class EnvConfig {
192192
}
193193
// Check --dart-define flags (native only)
194194
if (!kIsWeb) {
195-
return String
196-
.fromEnvironment(key)
197-
.isNotEmpty;
195+
return String.fromEnvironment(key).isNotEmpty;
198196
}
199197

200198
return false;

0 commit comments

Comments
 (0)