fromJson static method

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

Implementation

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

  return DraftMessage(
    replyTo: InputMessageReplyTo.fromJson(tdMapFromJson(json['reply_to'])),
    date: (json['date'] as int?) ?? 0,
    content: DraftMessageContent.fromJson(tdMapFromJson(json['content'])),
    effectId:
        int.tryParse((json['effect_id'] as dynamic)?.toString() ?? '') ?? 0,
    suggestedPostInfo: InputSuggestedPostInfo.fromJson(
      tdMapFromJson(json['suggested_post_info']),
    ),
  );
}