boxShadow static method

BoxShadow boxShadow(
  1. DataSource source,
  2. List<Object> key
)

Returns a BoxShadow from the specified map.

If the map is absent, returns null.

Otherwise (even if it has no keys), the BoxShadow is created from the keys color (see color, defaults to black), offset (see offset, defaults to Offset.zero), blurRadius (double, defaults to zero), and spreadRadius (double, defaults to zero).

Implementation

static BoxShadow boxShadow(DataSource source, List<Object> key) {
  if (!source.isMap(key)) {
    return const BoxShadow();
  }
  return BoxShadow(
    color: color(source, [...key, 'color']) ?? const Color(0xFF000000),
    offset: offset(source, [...key, 'offset']) ?? Offset.zero,
    blurRadius: source.v<double>([...key, 'blurRadius']) ?? 0.0,
    spreadRadius: source.v<double>([...key, 'spreadRadius']) ?? 0.0,
  );
}