radius static method

Radius? radius(
  1. DataSource source,
  2. List<Object> key
)

Returns a Radius from the specified map.

The map must have an x value corresponding to Radius.x, and may have a y value corresponding to Radius.y.

If the map only has an x key, the y value is assumed to be the same (as in Radius.circular).

If the x key is absent, the returned value is null.

Implementation

static Radius? radius(DataSource source, List<Object> key) {
  final double? x = source.v<double>([...key, 'x']);
  if (x == null) {
    return null;
  }
  final double y = source.v<double>([...key, 'y']) ?? x;
  return Radius.elliptical(x, y);
}