ChatShared.fromJson constructor

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

Creates a new ChatShared object from json.

Implementation

factory ChatShared.fromJson(Map<String, dynamic> json) {
  return ChatShared(
    requestId: json['request_id']!,
    chatId: json['chat_id']!,
    title: json['title'],
    username: json['username'],
    photo: json['photo'] != null
        ? (json['photo'] as List<dynamic>)
            .map((e) => PhotoSize.fromJson(e))
            .toList()
        : null,
  );
}