MessageModel.fromJson constructor

MessageModel.fromJson(
  1. Map<String, dynamic> jsonMap
)

Creates instance of SubscriptionModel with values read from json

Implementation

MessageModel.fromJson(Map<String, dynamic> jsonMap) {
  jsonMap.forEach((key, value) {
    if((key == 'isIncoming')&&(value is bool))  { _isIncoming = value; } else
    if((key == 'extension')&&(value is String)) { _ext = value;    } else
    if((key == 'accUri')&&(value is String))    { _accUri = value; } else
    if((key == 'body')&&(value is String))      { _body = value;   } else
    if((key == 'ts')&&(value is int))  {
       _timestamp = DateTime.fromMillisecondsSinceEpoch(value);
    }
  });
}