Bravia constructor Null safety

Bravia(
  1. String host,
  2. {int port = 80,
  3. String psk = '0000',
  4. int timeout = 5000}
)

Constructor takes IP address or hostname argument

Implementation

Bravia(String host,
    {int port = 80, String psk = '0000', int timeout = 5000}) {
  if (!host.contains('.')) {
    host += '.';
  }
  _host = host;
  _port = port;
  _psk = psk;
  _timeout = timeout;

  _url = _port != 80 ? 'http://$_host:$_port/sony' : 'http://$_host/sony';

  debug('Construct Bravia $host $psk $timeout $_url');
  accessControl = ServiceProtocol(this, 'accessControl');
  appControl = ServiceProtocol(this, 'appControl');
  audio = ServiceProtocol(this, 'audio');
  avContent = ServiceProtocol(this, 'avContent');
  browser = ServiceProtocol(this, 'browser');
  cec = ServiceProtocol(this, 'cec');
  encryption = ServiceProtocol(this, 'encryption');
  guide = ServiceProtocol(this, 'guide');
  recording = ServiceProtocol(this, 'recording');
  system = ServiceProtocol(this, 'system');
  videoScreen = ServiceProtocol(this, 'videoScreen');
}