fromMap static method

WebMessage? fromMap(
  1. Map<String, dynamic>? map
)

Gets a possible WebMessage instance from a Map value.

Implementation

static WebMessage? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = WebMessage(
    data: map['data'],
    ports: map['ports'] != null
        ? List<IWebMessagePort>.from(map['ports'].map((e) => e))
        : null,
    type: WebMessageType.fromNativeValue(map['type'])!,
  );
  return instance;
}