getSize method

Size? getSize(
  1. Map? spec
)

Implementation

Size? getSize(Map? spec) {
  if (spec == null || spec.isEmpty) return null;

  if (spec["width"] != null && spec["height"] != null) {
    return Size(parseDouble(spec["width"]), parseDouble(spec["height"]));
  } else if (spec["width"] != null) {
    return Size.fromWidth(parseDouble(spec["width"]));
  } else if (spec["height"] != null) {
    return Size.fromHeight(parseDouble(spec["height"]));
  } else {
    return null;
  }
}