parseMessage method

MessagePayload parseMessage(
  1. dynamic data
)

Implementation

MessagePayload parseMessage(dynamic data) {
  try {
    return MessagePayload.fromJson(json.decode(data));
  } catch (error) {
    return MessagePayload(type: 'unknown');
  }
}