|
|
@@ -12,6 +12,7 @@ import '../../resource/colors.gen.dart';
|
|
|
import '../../resource/string.gen.dart';
|
|
|
import '../../utils/clipboard_util.dart';
|
|
|
import '../../utils/url_launcher_util.dart';
|
|
|
+import 'enums/keyboard_guide_msg_type.dart';
|
|
|
|
|
|
/// 键盘引导页面
|
|
|
class KeyboardGuidePage extends BasePage<KeyboardGuidePageController> {
|
|
|
@@ -198,7 +199,7 @@ class KeyboardGuidePage extends BasePage<KeyboardGuidePageController> {
|
|
|
/// 构建聊天气泡
|
|
|
Widget _buildMsgBubble(KeyboardGuideMsg msg) {
|
|
|
// 设置气泡的外边距,让气泡不易过长
|
|
|
- double marginValue = 59.0;
|
|
|
+ double marginValue = 35.0;
|
|
|
EdgeInsets marginEdgeInsets;
|
|
|
if (msg.isMe) {
|
|
|
marginEdgeInsets = EdgeInsets.only(left: marginValue);
|
|
|
@@ -236,8 +237,10 @@ class KeyboardGuidePage extends BasePage<KeyboardGuidePageController> {
|
|
|
borderRadius: bgBorderRadius,
|
|
|
),
|
|
|
child: Row(
|
|
|
+ // 宽高包裹内容
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ // 图标和文本,垂直居中
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
children: [
|
|
|
Flexible(
|
|
|
// 消息文本
|
|
|
@@ -252,20 +255,11 @@ class KeyboardGuidePage extends BasePage<KeyboardGuidePageController> {
|
|
|
softWrap: true,
|
|
|
),
|
|
|
),
|
|
|
- // 只有对方发送的,才有复制按钮
|
|
|
+ // 只有对方发送的,才有操作按钮
|
|
|
if (!msg.isMe)
|
|
|
Padding(
|
|
|
padding: EdgeInsets.only(left: 8.0),
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () {
|
|
|
- // 复制内容到剪切板
|
|
|
- ClipboardUtil.copyToClipboard(msg.content);
|
|
|
- },
|
|
|
- child: Assets.images.iconCopy.image(
|
|
|
- width: 18.w,
|
|
|
- height: 18.w,
|
|
|
- ),
|
|
|
- ),
|
|
|
+ child: _buildMsgActionBtn(msg),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
@@ -273,6 +267,29 @@ class KeyboardGuidePage extends BasePage<KeyboardGuidePageController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ /// 消息操作按钮
|
|
|
+ Widget _buildMsgActionBtn(KeyboardGuideMsg msg) {
|
|
|
+ if (msg.type == KeyboardGuideMsgType.copy.type) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ // 复制内容到剪切板
|
|
|
+ ClipboardUtil.copyToClipboard(msg.content);
|
|
|
+ },
|
|
|
+ child: Assets.images.iconCopy.image(width: 18.w, height: 18.w),
|
|
|
+ );
|
|
|
+ } else if (msg.type == KeyboardGuideMsgType.intimacySetting.type) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ // 跳转到亲密度设置页
|
|
|
+ // TODO hezihao,需要志鹏提供路由路径,才能跳转到亲密度设置页
|
|
|
+ },
|
|
|
+ child: Assets.images.iconSetting.image(width: 18.w, height: 18.w),
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return SizedBox.shrink();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// 构建聊天消息列表项
|
|
|
Widget _buildMsgItem(KeyboardGuideMsg msg) {
|
|
|
Widget content;
|