supportsOperation method

  1. @override
bool supportsOperation(
  1. OperationType operationType,
  2. String? subprotocol
)
override

Indicates whether this ProtocolClientFactory supports a given operationType and subprotocol.

Implementation

@override
bool supportsOperation(OperationType operationType, String? subprotocol) {
  const unsupportedOperations = [
    OperationType.observeproperty,
    OperationType.unobserveproperty,
    OperationType.subscribeevent,
    OperationType.unsubscribeevent,
  ];

  if (unsupportedOperations.contains(operationType)) {
    return false;
  }

  if (subprotocol != null) {
    return false;
  }

  return true;
}