HanXinErrorLevel.fromJson constructor

HanXinErrorLevel.fromJson(
  1. dynamic data
)

Creates a HanXinErrorLevel instance from a JSON representation.

Implementation

HanXinErrorLevel.fromJson(dynamic data) {
  switch (data) {
    case "L1":
    case "L2":
    case "L3":
    case "L4":
      _value = data;
      break;
    default:
      throw Exception('Unknown enum value to decode: $data');
  }
}