toJson method

  1. @override
String? toJson(
  1. FontWeight? value
)
override

Implementation

@override
String? toJson(FontWeight? value) {
  if (value == null) return null;

  switch (value) {
    // case FontWeight.bold:
    //   return 'bold';
    //   break;

    // case FontWeight.normal:
    //   return 'normal';
    //   break;

    case FontWeight.w100:
      return 'w100';
      break;

    case FontWeight.w200:
      return 'w200';
      break;

    case FontWeight.w300:
      return 'w300';
      break;

    case FontWeight.w400:
      return 'w400';
      break;

    case FontWeight.w500:
      return 'w500';
      break;

    case FontWeight.w600:
      return 'w600';
      break;

    case FontWeight.w700:
      return 'w700';
      break;

    case FontWeight.w800:
      return 'w800';
      break;

    case FontWeight.w900:
      return 'w900';
      break;
  }

  throw 'Json_Unsuported_Value';
}