Skip to content

Commit c3dd8a2

Browse files
authored
fixed cid comparison (#598)
1 parent 69c76eb commit c3dd8a2

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

packages/stream_video/lib/src/call/call_type.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'package:equatable/equatable.dart';
2+
13
/// The type of call to be made.
24
///
35
/// The default type is [StreamCallType()] which is a normal call.
@@ -10,12 +12,11 @@
1012
/// ```dart
1113
/// StreamCallType.custom('custom_type');
1214
/// ```
13-
class StreamCallType {
14-
const StreamCallType._(this.value);
15+
class StreamCallType with EquatableMixin {
16+
factory StreamCallType() => const StreamCallType._('default');
1517

16-
final String value;
18+
const StreamCallType._(this.value);
1719

18-
factory StreamCallType() => const StreamCallType._('default');
1920
factory StreamCallType.liveStream() => const StreamCallType._('livestream');
2021
factory StreamCallType.development() => const StreamCallType._('development');
2122
factory StreamCallType.audioRoom() => const StreamCallType._('audio_room');
@@ -36,4 +37,12 @@ class StreamCallType {
3637
return StreamCallType.custom(type);
3738
}
3839
}
40+
41+
final String value;
42+
43+
@override
44+
String toString() => value;
45+
46+
@override
47+
List<Object?> get props => [value];
3948
}

packages/stream_video/lib/src/models/call_cid.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import '../call/call_type.dart';
66
@immutable
77
class StreamCallCid with EquatableMixin {
88
factory StreamCallCid({
9-
required String cid
9+
required String cid,
1010
}) {
1111
final typeAndId = cid.split(':');
1212
if (typeAndId.length != 2) {
1313
throw FormatException('invalid cid format: $cid');
1414
}
15-
15+
1616
return StreamCallCid._(
1717
value: cid,
1818
type: StreamCallType.fromString(typeAndId.first),

0 commit comments

Comments
 (0)