deserialize method

  1. @override
void deserialize(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
void deserialize(Map<String, dynamic>? json) {
  if (json == null) {
    throw ApiException(
        400, 'Failed to deserialize WatermarkDataText data model.');
  }

  super.deserialize(json);
  if (json.containsKey('Color')) {
    color = ModelBase.createInstance<XmlColor>(
        json['Color'] as Map<String, dynamic>);
  } else {
    color = null;
  }

  if (json.containsKey('FontFamily')) {
    fontFamily = json['FontFamily'] as String;
  } else {
    fontFamily = null;
  }

  if (json.containsKey('FontSize')) {
    fontSize = json['FontSize'] as double;
  } else {
    fontSize = null;
  }

  if (json.containsKey('IsSemitrasparent')) {
    isSemitrasparent = json['IsSemitrasparent'] as bool;
  } else {
    isSemitrasparent = null;
  }

  if (json.containsKey('Layout')) {
    switch (json['Layout'] as String) {
      case 'Horizontal':
        layout = WatermarkDataText_LayoutEnum.horizontal;
        break;
      case 'Diagonal':
        layout = WatermarkDataText_LayoutEnum.diagonal;
        break;
      default:
        layout = null;
        break;
    }
  } else {
    layout = null;
  }

  if (json.containsKey('Text')) {
    text = json['Text'] as String;
  } else {
    text = null;
  }
}