Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
24146a9
feat 完成会话页面
JiangJuHong Dec 8, 2023
9f97a2d
feat 会话页面、会话条目组件调整,相关显示内容进行调整
JiangJuHong Dec 8, 2023
e35ef4a
feat 增加扩展仓库说明
JiangJuHong Dec 8, 2023
83e6fc8
feat 增加参数:`inputPanelBackgroundColor`,设置输入框区域的背景颜色(注:此属性实际上应该放在TUIThe…
Huic-Read-Only Dec 9, 2023
faf64bf
### [tim_uikit_chat.dart](lib%2Fui%2Fviews%2FTIMUIKitChat%2Ftim_uikit…
Huic-Read-Only Dec 10, 2023
11fdfc2
### [tim_uikit_chat.dart](lib%2Fui%2Fviews%2FTIMUIKitChat%2Ftim_uikit…
Huic-Read-Only Dec 10, 2023
7fc90d8
feat 增加参数:`stickerPanelBackgroundColor`,设置表情面板背景颜色
Huic-Read-Only Dec 10, 2023
826fbc4
feat 增加参数:`stickerPanelPadding`,设置表情面板内边距
Huic-Read-Only Dec 10, 2023
ed81159
feat 增加参数:`morePanelBorder`,设置更多面板边框
Huic-Read-Only Dec 10, 2023
6127c22
Merge remote-tracking branch 'upstream/main'
JiangJuHong Jan 8, 2024
e0678c4
feat 增加avatarSize,可以控制头像组件大小
Huic-Read-Only Jan 18, 2024
3d83db9
feat 升级extended_text版本
Huic-Read-Only Feb 21, 2024
97558b2
feat 回退extended_text版本
Huic-Read-Only Feb 21, 2024
a0a1330
feat 回退extended_text版本
Huic-Read-Only Feb 21, 2024
9eec780
feat 回退extended_text版本
Huic-Read-Only Feb 21, 2024
f035ee7
feat 回退extended_text版本
Huic-Read-Only Feb 21, 2024
3688b5b
### [tim_uikit_multi_select_panel.dart](lib%2Fui%2Fviews%2FTIMUIKitCh…
JiangJuHong Mar 1, 2024
8eb0bce
Merge remote-tracking branch 'upstream/main'
Huic-Read-Only Jun 11, 2024
32d5151
feat 升级到flutter最新版本
Huic-Read-Only Jun 11, 2024
01acd3b
Merge remote-tracking branch '官方/main'
Huic-Read-Only Dec 25, 2024
2147475
feat 升级Flutter最新版本,升级gradle版本
Huic-Read-Only Dec 25, 2024
6d1a899
fix 修复草稿问题
Huic-Read-Only Dec 26, 2024
dce04fe
fix 修复 OPPO 机型渲染错误的问题
Jan 29, 2025
bbd3d34
fix 修复消息发送收费 bug
Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

# fvm
.fvm/flutter_sdk
63 changes: 63 additions & 0 deletions JJH_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 改动说明
扩展仓库: https://github.com/JiangJuHong/chat-uikit-flutter
fork来源:https://github.com/TencentCloud/chat-uikit-flutter

此仓库:在原有基础上增加通用性适配扩展,此改动不涉及到具体项目业务,尽可能的在原有基础上增加通用适配性,适应更多场景,改动说明参考以下内容:

## 改动明细
### [tim_uikit_conversation_item.dart](lib%2Fui%2Fviews%2FTIMUIKitConversation%2Ftim_uikit_conversation_item.dart)
* feat 增加参数:`avatarBuilder`,使用时可直接传入该构建器替换默认头像显示组件
* feat 修改参数:`nickName` 从 string 类型替换为 Widget 类型,并增加DefaultTextStyle保持原有样式不变
* feat 将 边框提取到 [tim_uikit_conversation.dart](lib%2Fui%2Fviews%2FTIMUIKitConversation%2Ftim_uikit_conversation.dart) 组件中
* feat 增加 avatarSize 属性,可以自定义会话组件头像区域大小

### [tim_uikit_conversation.dart](lib%2Fui%2Fviews%2FTIMUIKitConversation%2Ftim_uikit_conversation.dart)
* feat 将 ListView.builder 修改为 ListView.separated
* feat 增加属性 separatorBuilder,可通过外部传入自定义分割线样式

### [tim_uikit_conversation_draft_text.dart](lib%2Fui%2Fviews%2FTIMUIKitConversation%2Ftim_uikit_conversation_draft_text.dart)
* feat 以Rich的方式完全重写内容展示格式,解决:草稿字样和内容未对齐问题、显示草稿时和不显示草稿时样式有细微差别的问题

### [tim_uikit_conversation_last_msg.dart](lib%2Fui%2Fviews%2FTIMUIKitConversation%2Ftim_uikit_conversation_last_msg.dart)
* feat 以Rich的方式完全重写内容展示格式,解决显示草稿时和不显示草稿时样式有细微差别的问题,调整行高和草稿时的一致,均为1.0
* fix 修复草稿内容不显示问题

### [tim_uikit_chat.dart](lib%2Fui%2Fviews%2FTIMUIKitChat%2Ftim_uikit_chat.dart)
* feat 增加参数:`inputPanelBackgroundColor`,设置输入框区域的背景颜色(注:此属性实际上应该放在TUITheme中,但是此开源库无修改TUITheme的权限,故而提取为组件参数)
* feat 增加参数:`inputIconColor`,设置输入框区域的图标颜色(注:此属性实际上应该放在TUITheme中,但是此开源库无修改TUITheme的权限,故而提取为组件参数)
* feat 增加参数:`inputSoundBuilder`,语音组件显示构建器
* feat 增加参数:`inputDecoration`,自定义输入框的Decoration
* feat 增加参数:`stickerPanelBackgroundColor`,设置表情面板背景颜色
* feat 增加参数:`stickerPanelPadding`,设置表情面板内边距
* feat 增加参数:`morePanelBorder`,设置更多面板的边框

### [narrow.dart](lib%2Fui%2Fviews%2FTIMUIKitChat%2FTIMUIKitTextField%2Ftim_uikit_text_field_layout%2Fnarrow.dart)
* feat 增加参数:`iconColor`,设置图标颜色(注:此属性实际上应该放在TUITheme中,但是此开源库无修改TUITheme的权限,故而提取为组件参数)
* feat 增加参数:`soundBuilder`,语音组件显示构建器
* feat 增加参数:`inputDecoration`,自定义输入框的Decoration
* feat 增加参数:`stickerPanelBackgroundColor`,设置表情面板背景颜色
* feat 增加参数:`stickerPanelPadding`,设置表情面板内边距
* feat 增加参数:`morePanelBorder`,设置更多面板的边框

### [tim_uikit_text_field.dart](lib%2Fui%2Fviews%2FTIMUIKitChat%2FTIMUIKitTextField%2Ftim_uikit_text_field.dart)
* feat 增加参数:`iconColor`,设置图标颜色(注:此属性实际上应该放在TUITheme中,但是此开源库无修改TUITheme的权限,故而提取为组件参数)
* feat 增加参数:`soundBuilder`,语音组件显示构建器
* feat 增加参数:`inputDecoration`,自定义输入框的Decoration
* feat 增加参数:`stickerPanelBackgroundColor`,设置表情面板背景颜色
* feat 增加参数:`stickerPanelPadding`,设置表情面板内边距
* feat 增加参数:`morePanelBorder`,设置更多面板的边框

### [tim_uikit_send_sound_message.dart](lib%2Fui%2Fviews%2FTIMUIKitChat%2FTIMUIKitTextField%2Ftim_uikit_send_sound_message.dart)
* feat 增加参数:`builder`,可由用户自定义组件渲染

### [tim_uikit_more_panel.dart](lib%2Fui%2Fviews%2FTIMUIKitChat%2FTIMUIKitTextField%2Ftim_uikit_more_panel.dart)
* feat 增加参数:`border`,可由用户自定义边框

### [tim_uikit_multi_select_panel.dart](lib%2Fui%2Fviews%2FTIMUIKitChat%2Ftim_uikit_multi_select_panel.dart)
* fix 修复image图片大小设置不生效的问题:引用: [https://github.com/flutter/flutter/issues/137580](https://github.com/flutter/flutter/issues/137580)

### [image_screen.dart](lib%2Fui%2Fwidgets%2Fimage_screen.dart)
* fix 修复image图片大小设置不生效的问题:引用: [https://github.com/flutter/flutter/issues/137580](https://github.com/flutter/flutter/issues/137580)

### [center_play_button.dart](lib%2Fui%2Fwidgets%2Fcenter_play_button.dart)[image_screen.dart](lib%2Fui%2Fwidgets%2Fimage_screen.dart)
* fix 修复image图片大小设置不生效的问题:引用: [https://github.com/flutter/flutter/issues/137580](https://github.com/flutter/flutter/issues/137580)
1 change: 0 additions & 1 deletion example/lib/TIMUIKitChatExample.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class TIMUIKitChatExample extends StatelessWidget {
config: const TIMUIKitChatConfig(
// 仅供演示,非全部配置项,实际使用中,可只传和默认项不同的参数,无需传入所有开关
isAllowClickAvatar: true,
isUseDefaultEmoji: true,
isAllowLongPressMessage: true,
isShowReadingStatus: true,
isShowGroupReadingStatus: true,
Expand Down
3 changes: 3 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import 'TIMUIKitAddFriendExample.dart';
import 'TIMUIKitAddGroupExample.dart';
import 'TIMUIKitBlackListExample.dart';
import 'TIMUIKitChatExample.dart';
import 'TIMUIKitContactExample.dart';
import 'TIMUIKitConversationExample.dart';
import 'TIMUIKitGroupExample.dart';
import 'TIMUIKitGroupProfileExample.dart';
import 'TIMUIKitNewContactExample.dart';
import 'TIMUIKitProfileExample.dart';
import 'TIMUIKitSearchExample.dart';

void main() {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
tencent_cloud_chat_uikit:
path: ../../tim_ui_kit
path: ../
tencent_im_sdk_plugin_web: ^0.3.9
archive: ^3.3.0
tencent_im_sdk_plugin_desktop: ^0.1.13
Expand Down
6 changes: 4 additions & 2 deletions lib/business_logic/life_cycle/chat_life_cycle.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:tencent_cloud_chat_uikit/business_logic/life_cycle/base_life_cycle.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';

typedef FutureVoidCallback = Future<void> Function();

class ChatLifeCycle {
/// Before a new message will be added to historical message list from long connection.
/// You may not render this message by return null.
Expand All @@ -11,7 +13,7 @@ class ChatLifeCycle {

/// Before a new message will be sent.
/// Returns null can block the message from sending.
// Future<V2TimMessage?> Function(V2TimMessage message, [V2TimMessage? repliedMessage]) messageWillSend;
FutureVoidCallback? messageWillSend;

/// After a new message been sent.
MessageFunctionNullCallback messageDidSend;
Expand Down Expand Up @@ -43,7 +45,7 @@ class ChatLifeCycle {
this.shouldDeleteMessage = DefaultLifeCycle.defaultAsyncBooleanSolution,
this.messageDidSend = DefaultLifeCycle.defaultNullCallbackSolution,
this.didGetHistoricalMessageList = DefaultLifeCycle.defaultMessageListSolution,
// this.messageWillSend = DefaultLifeCycle.defaultTwoMessagesSolution,
this.messageWillSend,
this.modifiedMessageWillMount = DefaultLifeCycle.defaultMessageSolution,
this.newMessageWillMount = DefaultLifeCycle.defaultMessageSolution,
this.messageShouldMount = DefaultLifeCycle.defaultBooleanSolution,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ class TUIChatSeparateViewModel extends ChangeNotifier {
String? localCustomData,
bool? isEditStatusMessage = false,
}) async {
if (lifeCycle?.messageWillSend != null) await lifeCycle!.messageWillSend!();
String receiver = convType == ConvType.c2c ? convID : '';
String groupID = convType == ConvType.group ? convID : '';
if (convType == ConvType.group && _groupType == null) {
Expand Down Expand Up @@ -1149,6 +1150,7 @@ class TUIChatSeparateViewModel extends ChangeNotifier {
sendForwardMessage({
required List<V2TimConversation> conversationList,
}) async {
if (lifeCycle?.messageWillSend != null) await lifeCycle!.messageWillSend!();
final selectedMessages = getSelectedMessageList();
for (var conversation in conversationList) {
final convID = conversation.groupID ?? conversation.userID ?? "";
Expand Down Expand Up @@ -1195,6 +1197,7 @@ class TUIChatSeparateViewModel extends ChangeNotifier {
required List<String> abstractList,
required BuildContext context,
}) async {
if (lifeCycle?.messageWillSend != null) await lifeCycle!.messageWillSend!();
final List<String> msgIDList = getSelectedMessageList()
.map((e) => e.msgID ?? "")
.where((element) => element != "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ class MorePanel extends StatefulWidget {
/// 会话类型
final ConvType conversationType;

/// 边框
final BoxBorder? border;

final MorePanelConfig? morePanelConfig;

const MorePanel(
{required this.conversationID,
required this.conversationType,
Key? key,
this.morePanelConfig})
this.morePanelConfig,
this.border})
: super(key: key);

@override
Expand Down Expand Up @@ -726,7 +730,7 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
height: 248,
decoration: BoxDecoration(
// color: hexToColor("EBF0F6"),
border: Border(
border: widget.border ?? Border(
top: BorderSide(width: 1, color: Colors.grey.shade300),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import 'package:tencent_cloud_chat_uikit/ui/utils/sound_record.dart';
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
import 'package:tencent_cloud_chat_uikit/ui/utils/logger.dart';

/// 内容构建器
typedef SoundBuilderCallback = Widget Function(BuildContext context, bool isRecording);

class SendSoundMessage extends StatefulWidget {
/// conversation ID
final String conversationID;
Expand All @@ -27,11 +30,15 @@ class SendSoundMessage extends StatefulWidget {
/// the conversation type
final ConvType conversationType;

/// 构建器
final SoundBuilderCallback? builder;

const SendSoundMessage(
{required this.conversationID,
required this.conversationType,
Key? key,
required this.onDownBottom})
required this.onDownBottom,
this.builder})
: super(key: key);

@override
Expand Down Expand Up @@ -301,7 +308,7 @@ class _SendSoundMessageState extends TIMUIKitState<SendSoundMessage> {
onLongPressMoveUpdate: onLongPressUpdate,
onLongPressEnd: onLongPressEnd,
onLongPressCancel: onLonePressCancel,
child: Container(
child: widget.builder != null ? widget.builder!(context, isRecording) : Container(
height: 35,
color: isRecording ? theme.weakBackgroundColor : Colors.white,
alignment: Alignment.center,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart';
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/wide.dart';

import 'tim_uikit_send_sound_message.dart';

enum MuteStatus { none, me, all }

typedef CustomStickerPanel = Widget Function({
Expand Down Expand Up @@ -100,6 +102,24 @@ class TIMUIKitInputTextField extends StatefulWidget {

final String? groupID;

/// 图标颜色
final Color? iconColor;

/// 语音组件构建器
final SoundBuilderCallback? soundBuilder;

/// 自定义输入框的 Decoration
final InputDecoration? inputDecoration;

/// 表情面板背景颜色
final Color? stickerPanelBackgroundColor;

/// 表情面板内边距
final EdgeInsetsGeometry? stickerPanelPadding;

/// 更多面板边框
final BoxBorder? morePanelBorder;

const TIMUIKitInputTextField(
{Key? key,
required this.conversationID,
Expand All @@ -122,7 +142,13 @@ class TIMUIKitInputTextField extends StatefulWidget {
this.groupType,
this.atMemberPanelScroll,
this.groupID,
this.chatConfig})
this.chatConfig,
this.iconColor,
this.soundBuilder,
this.inputDecoration,
this.stickerPanelBackgroundColor,
this.stickerPanelPadding,
this.morePanelBorder})
: super(key: key);

@override
Expand Down Expand Up @@ -999,6 +1025,11 @@ class _InputTextFieldState extends TIMUIKitState<TIMUIKitInputTextField> {
return TUIKitScreenUtils.getDeviceWidget(
context: context,
defaultWidget: TIMUIKitTextFieldLayoutNarrow(
morePanelBorder: widget.morePanelBorder,
stickerPanelPadding: widget.stickerPanelPadding,
stickerPanelBackgroundColor: widget.stickerPanelBackgroundColor,
inputDecoration: widget.inputDecoration,
soundBuilder: widget.soundBuilder,
stickerPackageList: stickerPackageList,
onEmojiSubmitted: _onEmojiSubmitted,
onCustomEmojiFaceSubmitted: _onCustomEmojiFaceSubmitted,
Expand All @@ -1008,6 +1039,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMUIKitInputTextField> {
onChanged: widget.onChanged,
onDeleteText: _onDeleteText,
backgroundColor: widget.backgroundColor,
iconColor: widget.iconColor,
morePanelConfig: widget.morePanelConfig,
repliedMessage: value,
currentCursor: currentCursor,
Expand Down
Loading