feat: 接听按钮新增部分处理
This commit is contained in:
parent
5574dc8043
commit
50366de1d0
@ -98,10 +98,7 @@ class _StarChartPageState extends State<StarChartPage> {
|
|||||||
label: '挂断'.tr,
|
label: '挂断'.tr,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (!state.isClickHangUp.value) {
|
logic.initiateHangUpCommand();
|
||||||
logic.initiateHangUpCommand();
|
|
||||||
state.isClickHangUp.value = true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
buildIconButton(
|
buildIconButton(
|
||||||
@ -122,17 +119,19 @@ class _StarChartPageState extends State<StarChartPage> {
|
|||||||
|
|
||||||
Widget buildAnswerButton() {
|
Widget buildAnswerButton() {
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
final bool isDuringCall =
|
// final bool isDuringCall =
|
||||||
state.talkStatus.value == TalkStatus.duringCall.index;
|
// state.talkStatus.value == TalkStatus.duringCall.index;
|
||||||
return buildIconButton(
|
return buildIconButton(
|
||||||
icon: isDuringCall
|
icon: state.talkStatus.value == TalkStatus.duringCall.index
|
||||||
? 'images/main/icon_lockDetail_monitoringUnTalkback.png'
|
? 'images/main/icon_lockDetail_monitoringUnTalkback.png'
|
||||||
: 'images/main/icon_lockDetail_monitoringAnswerCalls.png',
|
: 'images/main/icon_lockDetail_monitoringAnswerCalls.png',
|
||||||
label: isDuringCall ? '长按说话'.tr : '接听'.tr,
|
label: state.talkStatus.value == TalkStatus.duringCall.index
|
||||||
|
? '长按说话'.tr
|
||||||
|
: '接听'.tr,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (!state.isClickAnswer.value) {
|
if (state.talkStatus.value == TalkStatus.waitingAnswer.index) {
|
||||||
logic.initiateAnswerCommand();
|
logic.initiateAnswerCommand();
|
||||||
state.isClickAnswer.value = true;
|
setState(() {});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
|
|||||||
@ -80,7 +80,7 @@ class StartChartManage {
|
|||||||
// 默认通话的期望数据格式
|
// 默认通话的期望数据格式
|
||||||
TalkExpect defaultTalkExpect = TalkExpect(
|
TalkExpect defaultTalkExpect = TalkExpect(
|
||||||
videoType: [TalkExpect_VideoTypeE.IMAGE],
|
videoType: [TalkExpect_VideoTypeE.IMAGE],
|
||||||
audioType: [],
|
audioType: [TalkExpect_AudioTypeE.G711],
|
||||||
);
|
);
|
||||||
|
|
||||||
// 默认通话数据
|
// 默认通话数据
|
||||||
@ -295,7 +295,8 @@ class StartChartManage {
|
|||||||
// 取到分包数据
|
// 取到分包数据
|
||||||
List<int> packet = payload.sublist(start, end);
|
List<int> packet = payload.sublist(start, end);
|
||||||
|
|
||||||
final messageId = MessageCommand.getNextMessageId(toPeerId, increment: false);
|
final messageId =
|
||||||
|
MessageCommand.getNextMessageId(toPeerId, increment: false);
|
||||||
// 组装分包数据
|
// 组装分包数据
|
||||||
final message = MessageCommand.echoMessage(
|
final message = MessageCommand.echoMessage(
|
||||||
ToPeerId: toPeerId,
|
ToPeerId: toPeerId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user