GraphicsUnit.fromJson constructor

GraphicsUnit.fromJson(
  1. dynamic data
)

Creates a GraphicsUnit instance from a JSON representation.

Implementation

GraphicsUnit.fromJson(dynamic data) {
  switch (data) {
    case 'Pixel':
    case 'Point':
    case 'Inch':
    case 'Millimeter':
      _value = data;
      break;
    default:
      throw Exception('Unknown enum value to decode: $data');
  }
}