BaseContent.fromType constructor

BaseContent.fromType(
  1. String msgType
)

Implementation

BaseContent.fromType(String msgType) {
  DateTime now = DateTime.now();
  _type = msgType;
  _sn = InstantMessage.generateSerialNumber(msgType, now);
  _time = now;
  this['type'] = _type;
  this['sn'] = _sn;
  setDateTime('time', _time);
}