FontStyle.fromJson constructor

FontStyle.fromJson(
  1. dynamic data
)

Creates a FontStyle instance from a JSON representation.

Implementation

FontStyle.fromJson(dynamic data) {
  switch (data) {
    case "Regular":
    case "Bold":
    case "Italic":
    case "Underline":
    case "Strikeout":
      _value = data;
      break;
    default:
      throw Exception('Unknown enum value to decode: $data');
  }
}