boxShadow method
Retrieves a list of BoxShadow values from the JSON map for the given key.
Looks up the value associated with key in the JSON. If the value is already a List<BoxShadow>,
it is returned as is. If the value is a List, it attempts to parse it into a list of BoxShadow.
Otherwise, it returns defaultValue.
key: The key to look up in the JSON map. Defaults to 'boxShadow'.defaultValue: The value to return if the key is not found or cannot be resolved. Defaults to null.
Returns:
Implementation
@preferInline
List<BoxShadow>? boxShadow({
String key = FlutterPropertyKeys.boxShadow,
List<BoxShadow>? defaultValue,
Object? target,
bool warmUp = false,
}) {
final value = _readProp(key, target, warmUp);
if (value is List<BoxShadow>) return value;
if (value == null) return defaultValue;
switch (value) {
case List():
if (envAttributeWarmUpEnabled) {
if (warmUp) {
return value.map<BoxShadow>(_boxShadowFromMap).toList();
} else {
return _json[key] =
value.map<BoxShadow>(_boxShadowFromMap).toList();
}
} else {
return _json[key] = value.map<BoxShadow>(_boxShadowFromMap).toList();
}
default:
return defaultValue;
}
}