Browse Source
feat(call): 实现通话类型图标区分和RTC频道管理功能
feat(call): 实现通话类型图标区分和RTC频道管理功能
- 根据通话类型显示不同的图标:视频通话显示视频图标,语音通话显示语音图标 - 为通话项添加颜色区分,发送方显示白色,接收方显示橙色 - 新增消费一对一RTC频道响应模型定义 - 实现观众离开时断开RTC频道连接功能 - 优化主播离开时的RTC频道销毁逻辑 - 为语音和视频通话分别显示对应的价格信息master
4 changed files with 69 additions and 5 deletions
Split View
Diff Options
-
17lib/controller/discover/room_controller.dart
-
42lib/model/rtc/consume_rtc_channel_response.dart
-
8lib/widget/message/call_item.dart
-
7lib/widget/message/call_type_selection_dialog.dart
@ -0,0 +1,42 @@ |
|||
/// 消费一对一RTC频道响应模型 |
|||
class ConsumeRtcChannelResponse { |
|||
final bool isFree; |
|||
final int status; |
|||
final int availableBalance; |
|||
final int unitSellingBalance; |
|||
final String? code; |
|||
|
|||
ConsumeRtcChannelResponse({ |
|||
required this.isFree, |
|||
required this.status, |
|||
required this.availableBalance, |
|||
required this.unitSellingBalance, |
|||
this.code, |
|||
}); |
|||
|
|||
factory ConsumeRtcChannelResponse.fromJson(Map<String, dynamic> json) { |
|||
return ConsumeRtcChannelResponse( |
|||
isFree: json['isFree'] as bool? ?? false, |
|||
status: json['status'] as int? ?? 0, |
|||
availableBalance: json['availableBalance'] as int? ?? 0, |
|||
unitSellingBalance: json['unitSellingBalance'] as int? ?? 0, |
|||
code: json['code'] as String?, |
|||
); |
|||
} |
|||
|
|||
Map<String, dynamic> toJson() { |
|||
return { |
|||
'isFree': isFree, |
|||
'status': status, |
|||
'availableBalance': availableBalance, |
|||
'unitSellingBalance': unitSellingBalance, |
|||
'code': code, |
|||
}; |
|||
} |
|||
|
|||
@override |
|||
String toString() { |
|||
return 'ConsumeRtcChannelResponse(isFree: $isFree, status: $status, availableBalance: $availableBalance, unitSellingBalance: $unitSellingBalance, code: $code)'; |
|||
} |
|||
} |
|||
|
|||
Write
Preview
Loading…
Cancel
Save