createFromString static method

SizedElement<num>? createFromString(
  1. String s
)

Implementation

static SizedElement? createFromString(String s) {
  if (s.contains('xy:')) {
    return XY(s);
  }

  if (s.contains('size:')) {
    return Size(s);
  }

  if (s.contains('orig:')) {
    return Orig(s);
  }

  if (s.contains('offset:')) {
    return Offset(s);
  }

  return null;
}