Skip to content

Commit 334b5a6

Browse files
Dillon Nysdnys1
authored andcommitted
fix(core): Remove dart define (temporary)
Removes dart defines from `AWSConfigValue` as a temporary solution to dart-lang/sdk#49245 commit-id:c75e6257
1 parent 637029e commit 334b5a6

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

packages/aws_common/lib/src/config/aws_config_value.dart

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ T _identity<T extends Object>(String o) => o as T;
2525
class AWSConfigValue<T extends Object> {
2626
const AWSConfigValue._(
2727
this.key,
28-
this._fromEnv,
28+
// TODO(dnys1): Add back when https://github.com/dart-lang/sdk/issues/49245 is resolved.
29+
// this._fromEnv,
2930
this.defaultValue, {
3031
T Function(String)? parse,
3132
}) : _parse = parse ?? _identity;
@@ -34,7 +35,8 @@ class AWSConfigValue<T extends Object> {
3435
/// should make for a single SDK operation invocation before giving up.
3536
static const AWSConfigValue<int> maxAttempts = AWSConfigValue<int>._(
3637
'AWS_MAX_ATTEMPTS',
37-
String.fromEnvironment('AWS_MAX_ATTEMPTS'),
38+
// TODO(dnys1): Add back when https://github.com/dart-lang/sdk/issues/49245 is resolved.
39+
// String.fromEnvironment('AWS_MAX_ATTEMPTS'),
3840
3,
3941
parse: int.parse,
4042
);
@@ -45,7 +47,8 @@ class AWSConfigValue<T extends Object> {
4547
/// The default value of the configuration parameter.
4648
final T defaultValue;
4749

48-
final String? _fromEnv;
50+
// TODO(dnys1): Add back when https://github.com/dart-lang/sdk/issues/49245 is resolved.
51+
// final String? _fromEnv;
4952
final T Function(String) _parse;
5053
String? get _fromPlatformEnv => lookupPlatformEnv(key);
5154

@@ -61,10 +64,11 @@ class AWSConfigValue<T extends Object> {
6164
} else if (fromOverride is String) {
6265
return _parse(fromOverride);
6366
}
64-
final fromEnv = _fromEnv;
65-
if (fromEnv != null && fromEnv.isNotEmpty) {
66-
return _parse(fromEnv);
67-
}
67+
// TODO(dnys1): Add back when https://github.com/dart-lang/sdk/issues/49245 is resolved.
68+
// final fromEnv = _fromEnv;
69+
// if (fromEnv != null && fromEnv.isNotEmpty) {
70+
// return _parse(fromEnv);
71+
// }
6872
final fromPlatformEnv = _fromPlatformEnv;
6973
if (fromPlatformEnv != null && fromPlatformEnv.isNotEmpty) {
7074
return _parse(fromPlatformEnv);

0 commit comments

Comments
 (0)