getOffset method

Offset? getOffset(
  1. dynamic value
)

Implementation

Offset? getOffset(dynamic value) {
  if (value == null) {
    return null;
  }

  if (value is num) {
    return Offset(parseDouble(value), parseDouble(value));
  }

  final parts = value.split(RegExp(r'[|\s]'));
  if (parts.length == 1) {
    return Offset(parseDouble(parts[0]), parseDouble(parts[0]));
  }
  return Offset(parseDouble(parts[0]), parseDouble(parts[1]));
}