Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions packages/stream_video/lib/src/call/call_type.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:equatable/equatable.dart';

/// The type of call to be made.
///
/// The default type is [StreamCallType()] which is a normal call.
Expand All @@ -10,12 +12,11 @@
/// ```dart
/// StreamCallType.custom('custom_type');
/// ```
class StreamCallType {
const StreamCallType._(this.value);
class StreamCallType with EquatableMixin {
factory StreamCallType() => const StreamCallType._('default');

final String value;
const StreamCallType._(this.value);

factory StreamCallType() => const StreamCallType._('default');
factory StreamCallType.liveStream() => const StreamCallType._('livestream');
factory StreamCallType.development() => const StreamCallType._('development');
factory StreamCallType.audioRoom() => const StreamCallType._('audio_room');
Expand All @@ -36,4 +37,12 @@ class StreamCallType {
return StreamCallType.custom(type);
}
}

final String value;

@override
String toString() => value;

@override
List<Object?> get props => [value];
}
4 changes: 2 additions & 2 deletions packages/stream_video/lib/src/models/call_cid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import '../call/call_type.dart';
@immutable
class StreamCallCid with EquatableMixin {
factory StreamCallCid({
required String cid
required String cid,
}) {
final typeAndId = cid.split(':');
if (typeAndId.length != 2) {
throw FormatException('invalid cid format: $cid');
}

return StreamCallCid._(
value: cid,
type: StreamCallType.fromString(typeAndId.first),
Expand Down