StreamingService constructor

StreamingService({
  1. required String name,
  2. required List<StreamingProfile> profiles,
  3. List<StreamingServer> servers = const <StreamingServer>[],
  4. String? key,
  5. String? defaultProfile,
  6. StreamingCredentials? credentials,
  7. bool customizableUrl = false,
})

Implementation

StreamingService({
  required this.name,
  required List<StreamingProfile> profiles,
  List<StreamingServer> servers = const <StreamingServer>[],
  this.key,
  this.defaultProfile,
  this.credentials,
  this.customizableUrl = false,
})  : profiles = List<StreamingProfile>.unmodifiable(profiles),
      servers = List<StreamingServer>.unmodifiable(servers) {
  if (name.isEmpty) {
    throw ArgumentError.value(name, 'name', 'Must not be empty.');
  }
  if (profiles.isEmpty) {
    throw ArgumentError.value(profiles, 'profiles', 'Must not be empty.');
  }
  if (!customizableUrl && servers.isEmpty) {
    throw ArgumentError.value(
      servers,
      'servers',
      'Must not be empty unless customizableUrl is true.',
    );
  }
}