fromJson static method

RichMessageSourceHtml? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static RichMessageSourceHtml? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return RichMessageSourceHtml(
    text: (json['text'] as String?) ?? '',
    media: List<InputRichMessageMedia>.from(
      tdListFromJson(json['media'])
          .map((item) => InputRichMessageMedia.fromJson(tdMapFromJson(item)))
          .whereType<InputRichMessageMedia>(),
    ),
  );
}