Event.fromUint8List constructor

Event.fromUint8List(
  1. Uint8List event
)

Implementation

factory Event.fromUint8List(Uint8List event) {
  String s = String.fromCharCodes(event);
  List<String> pList = s.trim().split("\n");
  Event e = Event(
      type: pList.first.replaceFirst("event:", "").trim(),
      data: pList.last.replaceFirst("data:", "").trim());
  return e;
}