fromString method

double fromString(
  1. String pixel
)

Implementation

double fromString(String pixel) {
  if (pixel == "xs") {
    return 12.0;
  } else if (pixel == "sm") {
    return 14.0;
  } else if (pixel == "base") {
    return 16.0;
  } else if (pixel == "lg") {
    return 18.0;
  } else if (pixel == "xl") {
    return 20.0;
  } else if (pixel == "2xl") {
    return 24.0;
  } else if (pixel == "3xl") {
    return 30.0;
  } else if (pixel == "4xl") {
    return 36.0;
  } else if (pixel == "5xl") {
    return 48.0;
  } else if (pixel == "6xl") {
    return 60.0;
  } else if (pixel == "7xl") {
    return 72.0;
  } else if (pixel == "8xl") {
    return 96.0;
  } else if (pixel == "9xl") {
    return 128.0;
  }

  return 16.0;
}