hasCapability method

  1. @override
bool hasCapability(
  1. SSECapability capability
)
override

Whether this implementation supports the given capability. Lets callers detect transport limitations at runtime — for example, the browser native EventSource does not support SSECapability.requestHeaders, so callers that need to authenticate must fall back to a URL-based scheme.

The default implementation returns false for every capability so adding a new capability constant (or adding this method to an existing external implementation) is source-compatible. Concrete implementations should override and report what they actually support.

Implementation

@override
bool hasCapability(SSECapability capability) =>
    _capabilities.contains(capability);