MessageList.fromJson constructor

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

Creates a MessageList from JSON.

Implementation

factory MessageList.fromJson(Map<String, dynamic> json) {
  return MessageList(
    object: json['object'] as String,
    data: (json['data'] as List<dynamic>)
        .map((e) => Message.fromJson(e as Map<String, dynamic>))
        .toList(),
    firstId: json['first_id'] as String?,
    lastId: json['last_id'] as String?,
    hasMore: json['has_more'] as bool,
  );
}