WebMessage constructor

WebMessage({
  1. dynamic data,
  2. WebMessageType type = WebMessageType.STRING,
  3. List<IWebMessagePort>? ports,
})

Implementation

WebMessage({this.data, this.type = WebMessageType.STRING, this.ports}) {
  assert(((this.data == null || this.data is String) &&
          this.type == WebMessageType.STRING) ||
      (this.data != null &&
          this.data is Uint8List &&
          this.type == WebMessageType.ARRAY_BUFFER));
}