fromMap static method

ChatEvent? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static ChatEvent? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var id = _map['id']! as int64;
  var date = _map['date']! as int;
  var member_id = MessageSender.fromMap(_map['member_id'])!;
  var action = ChatEventAction.fromMap(_map['action'])!;
  return ChatEvent(
    extra: extra,
    clientId: clientId,
    id: id,
    date: date,
    member_id: member_id,
    action: action,
  );
}