getsOrNull<T extends Object?> static method
List<T> ?
getsOrNull<T extends Object?>(
- String key, {
- String? path,
- List<
T> ? defaultValue, - EnvironmentType? environment,
- PlatformType? platform,
- T? parser()?,
- T? modifier(
- T
Implementation
static List<T>? getsOrNull<T extends Object?>(
String key, {
String? path,
List<T>? defaultValue,
EnvironmentType? environment,
PlatformType? platform,
T? Function(Object?)? parser,
T? Function(T)? modifier,
}) {
try {
final raw = i._select(
key,
path: path,
environment: environment,
platform: platform,
);
List<T>? value = raw.findsOrNull(builder: parser);
value ??= defaultValue;
if (modifier != null) {
value = value?.map(modifier).whereType<T>().toList();
}
return value;
} catch (msg) {
i._log(msg);
return defaultValue;
}
}