Browse Source
feat(message): 添加通话类型选择对话框
feat(message): 添加通话类型选择对话框
- 创建了 CallTypeSelectionDialog 组件用于选择通话类型 - 实现了语音通话和视频通话选项的UI界面 - 在聊天页面中集成了通话类型选择功能 - 将原有的视频通话回调替换为显示选择对话框 - 添加了通话类型选择的业务逻辑处理master
2 changed files with 157 additions and 13 deletions
Split View
Diff Options
@ -0,0 +1,106 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|||
|
|||
/// 通话类型选择弹框 |
|||
class CallTypeSelectionDialog extends StatelessWidget { |
|||
final VoidCallback? onVoiceCall; |
|||
final VoidCallback? onVideoCall; |
|||
|
|||
const CallTypeSelectionDialog({ |
|||
super.key, |
|||
this.onVoiceCall, |
|||
this.onVideoCall, |
|||
}); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return Container( |
|||
decoration: BoxDecoration( |
|||
color: Colors.white, |
|||
borderRadius: BorderRadius.only( |
|||
topLeft: Radius.circular(12.w), |
|||
topRight: Radius.circular(12.w), |
|||
), |
|||
), |
|||
child: Column( |
|||
mainAxisSize: MainAxisSize.min, |
|||
children: [ |
|||
// 语音通话选项 |
|||
InkWell( |
|||
onTap: () { |
|||
SmartDialog.dismiss(); |
|||
onVoiceCall?.call(); |
|||
}, |
|||
child: Container( |
|||
width: double.infinity, |
|||
padding: EdgeInsets.symmetric(vertical: 16.w), |
|||
child: Center( |
|||
child: Text( |
|||
'语音通话 (35玫瑰/分钟)', |
|||
style: TextStyle( |
|||
fontSize: 16.sp, |
|||
color: const Color.fromRGBO(51, 51, 51, 1), |
|||
), |
|||
), |
|||
), |
|||
), |
|||
), |
|||
// 分隔线 |
|||
Divider( |
|||
height: 1, |
|||
thickness: 1, |
|||
color: const Color.fromRGBO(240, 240, 240, 1), |
|||
), |
|||
// 视频通话选项 |
|||
InkWell( |
|||
onTap: () { |
|||
SmartDialog.dismiss(); |
|||
onVideoCall?.call(); |
|||
}, |
|||
child: Container( |
|||
width: double.infinity, |
|||
padding: EdgeInsets.symmetric(vertical: 16.w), |
|||
child: Center( |
|||
child: Text( |
|||
'视频通话 (35玫瑰/分钟)', |
|||
style: TextStyle( |
|||
fontSize: 16.sp, |
|||
color: const Color.fromRGBO(51, 51, 51, 1), |
|||
), |
|||
), |
|||
), |
|||
), |
|||
), |
|||
// 分隔线 |
|||
Divider( |
|||
height: 1, |
|||
thickness: 1, |
|||
color: const Color.fromRGBO(240, 240, 240, 1), |
|||
), |
|||
// 取消选项 |
|||
InkWell( |
|||
onTap: () { |
|||
SmartDialog.dismiss(); |
|||
}, |
|||
child: Container( |
|||
width: double.infinity, |
|||
padding: EdgeInsets.symmetric(vertical: 16.w), |
|||
child: Center( |
|||
child: Text( |
|||
'取消', |
|||
style: TextStyle( |
|||
fontSize: 16.sp, |
|||
color: const Color.fromRGBO(51, 51, 51, 1), |
|||
), |
|||
), |
|||
), |
|||
), |
|||
), |
|||
SizedBox(height: MediaQuery.of(context).padding.bottom), |
|||
], |
|||
), |
|||
); |
|||
} |
|||
} |
|||
|
|||
Write
Preview
Loading…
Cancel
Save