baseUrl property

String? get baseUrl

Indicates the url of the {@link HubConnection} to the server.

Implementation

String? get baseUrl => _connection.baseUrl ?? "";
set baseUrl (String? url)

Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or Reconnecting states. @param {string} url The url to connect to.

Implementation

set baseUrl(String? url) {
  if (_connectionState != HubConnectionState.Disconnected &&
      _connectionState != HubConnectionState.Reconnecting) {
    throw GeneralError(
        "The HubConnection must be in the Disconnected or Reconnecting state to change the url.");
  }

  if (url == null) {
    throw GeneralError("The HubConnection url must be a valid url.");
  }

  _connection.baseUrl = url;
}