decode static method

FontWeight? decode(
  1. dynamic json
)

Implementation

static FontWeight? decode(dynamic json) {
  if (json == null) {
    return null;
  }
  if (json is! String) {
    return null;
  }

  switch (json) {
    case 'ULTRA_LIGHT':
      return FontWeight.ULTRA_LIGHT;
    case 'THIN':
      return FontWeight.THIN;
    case 'LIGHT':
      return FontWeight.LIGHT;
    case 'REGULAR':
      return FontWeight.REGULAR;
    case 'MEDIUM':
      return FontWeight.MEDIUM;
    case 'SEMI_BOLD':
      return FontWeight.SEMI_BOLD;
    case 'BOLD':
      return FontWeight.BOLD;
    case 'HEAVY':
      return FontWeight.HEAVY;
    case 'BLACK':
      return FontWeight.BLACK;
    default:
      return FontWeight.UNKNOWN;
  }
}