Line data Source code
1 : class VoipId { 2 : final String roomId; 3 : final String callId; 4 : 5 0 : String get id => '$roomId:$callId'; 6 : 7 0 : factory VoipId.fromId(String id) { 8 0 : final int lastIndex = id.lastIndexOf(':'); 9 0 : return VoipId( 10 0 : roomId: id.substring(0, lastIndex), 11 0 : callId: id.substring(lastIndex + 1), 12 : ); 13 : } 14 : 15 2 : VoipId({required this.roomId, required this.callId}); 16 : 17 2 : @override 18 : bool operator ==(Object other) => 19 : identical(this, other) || 20 14 : (other is VoipId && roomId == other.roomId && callId == other.callId); 21 : 22 2 : @override 23 10 : int get hashCode => Object.hash(roomId.hashCode, callId.hashCode); 24 : }