offset static method

Offset? offset(
  1. DataSource source,
  2. List<Object> key
)

Returns an Offset from the specified map.

The map must have an x key and a y key, doubles.

Implementation

static Offset? offset(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']);
  if (y == null) {
    return null;
  }
  return Offset(x, y);
}