StreamingService constructor
StreamingService({
- required String name,
- required List<
StreamingProfile> profiles, - List<
StreamingServer> servers = const <StreamingServer>[], - String? key,
- String? defaultProfile,
- StreamingCredentials? credentials,
- 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.',
);
}
}