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 CommentUpdate data model.');
  }

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

  if (json.containsKey('RangeEnd')) {
    rangeEnd = ModelBase.createInstance<PositionInsideNode>(
        json['RangeEnd'] as Map<String, dynamic>);
  } else {
    rangeEnd = null;
  }

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

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

  if (json.containsKey('DateTime')) {
    dateTime = DateTime.parse(json['DateTime'] as String);
  } else {
    dateTime = null;
  }

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