fromJson static method

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

Implementation

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

  return ChatPosition(
    list: ChatList.fromJson(tdMapFromJson(json['list'])),
    order: int.tryParse((json['order'] as dynamic)?.toString() ?? '') ?? 0,
    isPinned: (json['is_pinned'] as bool?) ?? false,
    source: ChatSource.fromJson(tdMapFromJson(json['source'])),
  );
}