getObject static method

SIQMessage getObject(
  1. Map map
)

Implementation

static SIQMessage getObject(Map map) {
  String? sender = map["sender"];
  // String? senderId = map["sender_id"];
  String? text = map["text"];
  // String? type = map["type"];
  double? _time = map["time"];
  // bool? sentByVisitor = map["sent_by_visitor"] ?? false;
  bool? isRead = map["is_read"];
  // Status? status = map["status"];
  Map? fileMap = map["file"];
  String? name = fileMap?["name"];
  String? comment = fileMap?["comment"];
  String? contentType = fileMap?["content_type"];
  int size = fileMap?["size"] ?? 0;
  File? file = File(name, comment, contentType, size);
  DateTime? time;
  if (_time != null) {
    time = _convertDoubleToDateTime(_time);
  }
  SIQMessage message = SIQMessage(text, sender, time, isRead, file);
  return message;
}