setEndpoint method Null safety

void setEndpoint(
  1. String url
)

Set Director API endpoint where requests will be sent.

url - New Director API endpoint

import 'package:millicast_flutter_sdk/src/director.dart';
void main() {
  String endpoint = '';
  endpoint = Director.getEndpoint();
  Director.setEndpoint('https://my.api.endpoint.com/');
  endpoint = Director.getEndpoint(); // https://my.api.endpoint.com
}

Implementation

static void setEndpoint(String url) {
  var matchLastSlash = RegExp(r'/$');
  apiEndpoint = url.replaceAll(matchLastSlash, '');
}