parseMessage function
Parse message to IrisEventMessage object
Implementation
// ignore: avoid_annotating_with_dynamic
IrisEventMessage parseMessage(dynamic message) {
final dataList = List.from(message);
final String event = dataList[0];
String data = dataList[1] as String;
if (data.isEmpty) {
data = '{}';
}
String res = dataList[1] as String;
if (res.isEmpty) {
res = '{}';
}
final List<Uint8List> buffers =
dataList.length == 3 ? List<Uint8List>.from(dataList[2]) : <Uint8List>[];
return IrisEventMessage(event, data, buffers);
}