setLiveDomain method Null safety
- String domain
Set Websocket Live domain from Director API response.
If it is set to empty, it will not parse the response.
domain
- New Websocket Live domain
void main() {
String liveDomain = '';
liveDomain = Director.getLiveDomain();
Director.setLiveDomain('https://my.livedomain.com/');
liveDomain = Director.getLiveDomain(); // 'https://my.livedomain.com'
}
Implementation
static void setLiveDomain(String domain) {
var matchLastSlash = RegExp(r'/$');
liveWebSocketDomain = domain.replaceAll(matchLastSlash, '');
}