Chat.fromJson constructor

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

Creates a Chat object from JSON.

Implementation

factory Chat.fromJson(Map<String, dynamic> json) {
  return Chat(
    id: json['id'],
    type: ChatType.fromJson(json['type'] as String),
    title: json['title'],
    username: json['username'],
    firstName: json['first_name'],
    lastName: json['last_name'],
    isForum: json['is_forum'] ?? false,
  );
}