update flutter uikit to 1.5.0
This commit is contained in:
parent
121e8c295f
commit
78bea5cef9
|
|
@ -1,8 +1,15 @@
|
||||||
|
|
||||||
|
## 1.5.0
|
||||||
|
|
||||||
|
* Add: New configuration `defaultAvatarAssetPath` on global `TIMUIKitConfig`, aiming to define the default avatar.
|
||||||
|
* Add: Supports Flutter 3.7.0.
|
||||||
|
* Fix: `chatBgColor` configuration.
|
||||||
|
|
||||||
## 1.4.0
|
## 1.4.0
|
||||||
|
|
||||||
* Add: Text translation. Long press the text messages and choose `Translate`. This function can be turn off by `showTranslation` from `ToolTipsConfig`.
|
* Add: Text translation. Long press the text messages and choose `Translate`. This function can be turn off by `showTranslation` from `ToolTipsConfig`.
|
||||||
* Optimize: The long press pop-up location.
|
* Optimize: The long press pop-up location.
|
||||||
* Optimize: keyboard pop-up event.
|
* Optimize: Keyboard pop-up event.
|
||||||
|
|
||||||
## 1.3.2
|
## 1.3.2
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 1.8 KiB |
|
|
@ -49,8 +49,8 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
|
|
||||||
late V2TimAdvancedMsgListener advancedMsgListener;
|
late V2TimAdvancedMsgListener advancedMsgListener;
|
||||||
int _unreadCountForConversation = 0;
|
int _unreadCountForConversation = 0;
|
||||||
// use for generate a new sliver list to show recived messag list
|
// use for generate a new sliver list to show received message list
|
||||||
int _recivedNewMessageCount = 0;
|
int _receivedNewMessageCount = 0;
|
||||||
TIMUIKitChatConfig chatConfig = const TIMUIKitChatConfig();
|
TIMUIKitChatConfig chatConfig = const TIMUIKitChatConfig();
|
||||||
List<V2TimGroupApplication>? _groupApplicationList;
|
List<V2TimGroupApplication>? _groupApplicationList;
|
||||||
String Function(V2TimMessage message)? _abstractMessageBuilder;
|
String Function(V2TimMessage message)? _abstractMessageBuilder;
|
||||||
|
|
@ -58,7 +58,7 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
Map.from({}); // 0 normal 1 sending
|
Map.from({}); // 0 normal 1 sending
|
||||||
final Map<String, bool> _c2cMessageFromUserActiveMap = Map.from({});
|
final Map<String, bool> _c2cMessageFromUserActiveMap = Map.from({});
|
||||||
final Map<String, Timer> _c2cMessageActiveTimer = Map.from({});
|
final Map<String, Timer> _c2cMessageActiveTimer = Map.from({});
|
||||||
bool _showC2cMessageEditStaus = true;
|
bool _showC2cMessageEditStatus = true;
|
||||||
final Map<String, Timer> _c2cMessageStatusShowTimer = Map.from({});
|
final Map<String, Timer> _c2cMessageStatusShowTimer = Map.from({});
|
||||||
Map<String, List> loadingMessage = {};
|
Map<String, List> loadingMessage = {};
|
||||||
|
|
||||||
|
|
@ -73,8 +73,8 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
onRecvNewMessage: (V2TimMessage newMsg) {
|
onRecvNewMessage: (V2TimMessage newMsg) {
|
||||||
_onReceiveNewMsg(newMsg);
|
_onReceiveNewMsg(newMsg);
|
||||||
},
|
},
|
||||||
onSendMessageProgress: (V2TimMessage messagae, int progress) {
|
onSendMessageProgress: (V2TimMessage message, int progress) {
|
||||||
_onSendMessageProgress(messagae, progress);
|
_onSendMessageProgress(message, progress);
|
||||||
},
|
},
|
||||||
onRecvMessageReadReceipts: (List<V2TimMessageReceipt> receiptList) {
|
onRecvMessageReadReceipts: (List<V2TimMessageReceipt> receiptList) {
|
||||||
_onReceiveMessageReadReceipts(receiptList);
|
_onReceiveMessageReadReceipts(receiptList);
|
||||||
|
|
@ -150,7 +150,7 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
// downloadFile();
|
// downloadFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
int getRecevied(msgID) {
|
int getReceived(msgID) {
|
||||||
return messageListProgressMap[msgID] ?? 0;
|
return messageListProgressMap[msgID] ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -178,8 +178,8 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
return _totalUnreadCount;
|
return _totalUnreadCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get recivedMessageListCount {
|
int get receivedMessageListCount {
|
||||||
return _recivedNewMessageCount;
|
return _receivedNewMessageCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get unreadCountForConversation => _unreadCountForConversation;
|
int get unreadCountForConversation => _unreadCountForConversation;
|
||||||
|
|
@ -218,7 +218,7 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
setShowC2cEditStatus(bool show) {
|
setShowC2cEditStatus(bool show) {
|
||||||
_showC2cMessageEditStaus = show;
|
_showC2cMessageEditStatus = show;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// set edit status from chats
|
/// set edit status from chats
|
||||||
|
|
@ -375,14 +375,14 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
_totalUnreadCount = 0;
|
_totalUnreadCount = 0;
|
||||||
_groupApplicationList?.clear();
|
_groupApplicationList?.clear();
|
||||||
_totalUnreadCount = 0;
|
_totalUnreadCount = 0;
|
||||||
_recivedNewMessageCount = 0;
|
_receivedNewMessageCount = 0;
|
||||||
_messageReadReceiptMap.clear();
|
_messageReadReceiptMap.clear();
|
||||||
_messageListProgressMap.clear();
|
_messageListProgressMap.clear();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
clearRecivedNewMessageCount() {
|
clearRecivedNewMessageCount() {
|
||||||
_recivedNewMessageCount = 0;
|
_receivedNewMessageCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_preLoadImage(List<V2TimMessage> msgList) {
|
_preLoadImage(List<V2TimMessage> msgList) {
|
||||||
|
|
@ -528,7 +528,7 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
sendEditStatusMessage(bool isEditing, String toUser) async {
|
sendEditStatusMessage(bool isEditing, String toUser) async {
|
||||||
if (!_showC2cMessageEditStaus) {
|
if (!_showC2cMessageEditStatus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(_c2cMessageFromUserActiveMap[toUser] ?? false)) {
|
if (!(_c2cMessageFromUserActiveMap[toUser] ?? false)) {
|
||||||
|
|
@ -602,7 +602,7 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
convID: convID,
|
convID: convID,
|
||||||
convType: currentSelectedConvType!,
|
convType: currentSelectedConvType!,
|
||||||
);
|
);
|
||||||
_recivedNewMessageCount = 0;
|
_receivedNewMessageCount = 0;
|
||||||
final currentMsg = _messageListMap[convID] ?? [];
|
final currentMsg = _messageListMap[convID] ?? [];
|
||||||
_messageListMap[convID] = [newMsg, ...currentMsg];
|
_messageListMap[convID] = [newMsg, ...currentMsg];
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
@ -618,7 +618,7 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
} else {
|
} else {
|
||||||
if (convID == currentSelectedConv) {
|
if (convID == currentSelectedConv) {
|
||||||
unreadCountForConversation++;
|
unreadCountForConversation++;
|
||||||
_recivedNewMessageCount++;
|
_receivedNewMessageCount++;
|
||||||
final currentMsg = _messageListMap[convID] ?? [];
|
final currentMsg = _messageListMap[convID] ?? [];
|
||||||
_messageListMap[convID] = [newMsg, ...currentMsg];
|
_messageListMap[convID] = [newMsg, ...currentMsg];
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
@ -880,7 +880,7 @@ class TUIChatGlobalModel extends ChangeNotifier with TIMUIKitClass {
|
||||||
{bool needResetNewMessageCount = true}) {
|
{bool needResetNewMessageCount = true}) {
|
||||||
_messageListMap[conversationID] = messageList;
|
_messageListMap[conversationID] = messageList;
|
||||||
if (needResetNewMessageCount) {
|
if (needResetNewMessageCount) {
|
||||||
_recivedNewMessageCount = 0;
|
_receivedNewMessageCount = 0;
|
||||||
}
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,11 @@ class TIMUIKitConfig {
|
||||||
/// type is `INFO`, while code is 6661403.
|
/// type is `INFO`, while code is 6661403.
|
||||||
final bool isCheckDiskStorageSpace;
|
final bool isCheckDiskStorageSpace;
|
||||||
|
|
||||||
|
/// The asset path of the default avatar image.
|
||||||
|
final String? defaultAvatarAssetPath;
|
||||||
|
|
||||||
const TIMUIKitConfig({
|
const TIMUIKitConfig({
|
||||||
|
this.defaultAvatarAssetPath,
|
||||||
this.isCheckDiskStorageSpace = true,
|
this.isCheckDiskStorageSpace = true,
|
||||||
this.isShowOnlineStatus = true,
|
this.isShowOnlineStatus = true,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -330,10 +330,10 @@ class _TIMUIKitHistoryMessageListState
|
||||||
|
|
||||||
final messageList = widget.messageList;
|
final messageList = widget.messageList;
|
||||||
final globalModel = context.read<TUIChatGlobalModel>();
|
final globalModel = context.read<TUIChatGlobalModel>();
|
||||||
final recivedNewMessageList = globalModel.recivedMessageListCount;
|
final receivedNewMessageList = globalModel.receivedMessageListCount;
|
||||||
final shouldShowUnreadMessage = recivedNewMessageList > 0;
|
final shouldShowUnreadMessage = receivedNewMessageList > 0;
|
||||||
final unreadMessageList = _getRecivedMessageList(recivedNewMessageList);
|
final unreadMessageList = _getRecivedMessageList(receivedNewMessageList);
|
||||||
final readedMessageList = messageList
|
final readMessageList = messageList
|
||||||
.sublist(unreadMessageList.length, messageList.length)
|
.sublist(unreadMessageList.length, messageList.length)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|
@ -350,144 +350,149 @@ class _TIMUIKitHistoryMessageListState
|
||||||
}
|
}
|
||||||
|
|
||||||
String getMessageIdentifier(V2TimMessage? message, int index) {
|
String getMessageIdentifier(V2TimMessage? message, int index) {
|
||||||
return "${message?.msgID} - ${message?.timestamp} - ${message?.seq} - ${message?.id}";
|
return "${message?.msgID} - ${message?.timestamp} - ${message?.seq}";
|
||||||
}
|
}
|
||||||
|
|
||||||
return Stack(
|
return Container(
|
||||||
alignment: Alignment.topCenter,
|
color: theme.chatBgColor,
|
||||||
children: [
|
child: Stack(
|
||||||
CustomScrollView(
|
alignment: Alignment.topCenter,
|
||||||
center: shouldShowUnreadMessage ? centerKey : null,
|
children: [
|
||||||
key: widget.mainHistoryListConfig?.key,
|
CustomScrollView(
|
||||||
primary: widget.mainHistoryListConfig?.primary,
|
center: shouldShowUnreadMessage ? centerKey : null,
|
||||||
physics: (widget.isAllowScroll == false)
|
key: widget.mainHistoryListConfig?.key,
|
||||||
? const NeverScrollableScrollPhysics()
|
primary: widget.mainHistoryListConfig?.primary,
|
||||||
: widget.mainHistoryListConfig?.physics,
|
physics: (widget.isAllowScroll == false)
|
||||||
// padding: widget.mainHistoryListConfig?.padding ?? EdgeInsets.zero,
|
? const NeverScrollableScrollPhysics()
|
||||||
// itemExtent: widget.mainHistoryListConfig?.itemExtent,
|
: widget.mainHistoryListConfig?.physics,
|
||||||
// prototypeItem: widget.mainHistoryListConfig?.prototypeItem,
|
// padding: widget.mainHistoryListConfig?.padding ?? EdgeInsets.zero,
|
||||||
cacheExtent: widget.mainHistoryListConfig?.cacheExtent ?? 1500,
|
// itemExtent: widget.mainHistoryListConfig?.itemExtent,
|
||||||
semanticChildCount: widget.mainHistoryListConfig?.semanticChildCount,
|
// prototypeItem: widget.mainHistoryListConfig?.prototypeItem,
|
||||||
dragStartBehavior: widget.mainHistoryListConfig?.dragStartBehavior ??
|
cacheExtent: widget.mainHistoryListConfig?.cacheExtent ?? 1500,
|
||||||
DragStartBehavior.start,
|
semanticChildCount: widget.mainHistoryListConfig?.semanticChildCount,
|
||||||
keyboardDismissBehavior:
|
dragStartBehavior: widget.mainHistoryListConfig?.dragStartBehavior ??
|
||||||
widget.mainHistoryListConfig?.keyboardDismissBehavior ??
|
DragStartBehavior.start,
|
||||||
ScrollViewKeyboardDismissBehavior.manual,
|
keyboardDismissBehavior:
|
||||||
restorationId: widget.mainHistoryListConfig?.restorationId,
|
widget.mainHistoryListConfig?.keyboardDismissBehavior ??
|
||||||
clipBehavior:
|
ScrollViewKeyboardDismissBehavior.manual,
|
||||||
widget.mainHistoryListConfig?.clipBehavior ?? Clip.hardEdge,
|
restorationId: widget.mainHistoryListConfig?.restorationId,
|
||||||
reverse: true,
|
clipBehavior:
|
||||||
shrinkWrap: !shouldShowUnreadMessage,
|
widget.mainHistoryListConfig?.clipBehavior ?? Clip.hardEdge,
|
||||||
controller: _autoScrollController,
|
reverse: true,
|
||||||
slivers: [
|
shrinkWrap: !shouldShowUnreadMessage,
|
||||||
SliverPadding(
|
controller: _autoScrollController,
|
||||||
padding: widget.mainHistoryListConfig?.padding ?? EdgeInsets.zero,
|
slivers: [
|
||||||
sliver: SliverList(
|
SliverPadding(
|
||||||
delegate: SliverChildBuilderDelegate(
|
padding: widget.mainHistoryListConfig?.padding ?? EdgeInsets.zero,
|
||||||
(BuildContext context, int index) {
|
sliver: SliverList(
|
||||||
final messageItem = unreadMessageList[index];
|
delegate: SliverChildBuilderDelegate(
|
||||||
return AutoScrollTag(
|
(BuildContext context, int index) {
|
||||||
controller: _autoScrollController,
|
final messageItem = unreadMessageList[index];
|
||||||
index: -index,
|
return AutoScrollTag(
|
||||||
key: ValueKey(
|
controller: _autoScrollController,
|
||||||
getMessageIdentifier(messageItem, index)),
|
index: -index,
|
||||||
highlightColor: Colors.black.withOpacity(0.1),
|
key: ValueKey(
|
||||||
child: KeepAliveWrapper(
|
getMessageIdentifier(messageItem, index)),
|
||||||
child: Container(
|
highlightColor: Colors.black.withOpacity(0.1),
|
||||||
padding: const EdgeInsets.symmetric(
|
child: KeepAliveWrapper(
|
||||||
horizontal: 16),
|
child: Container(
|
||||||
child: _getMessageItemBuilder(messageItem))),
|
padding: const EdgeInsets.symmetric(
|
||||||
);
|
horizontal: 16),
|
||||||
},
|
child: _getMessageItemBuilder(messageItem))),
|
||||||
childCount: unreadMessageList.length,
|
);
|
||||||
findChildIndexCallback: (Key key) {
|
},
|
||||||
final ValueKey<String> valueKey =
|
childCount: unreadMessageList.length,
|
||||||
key as ValueKey<String>;
|
findChildIndexCallback: (Key key) {
|
||||||
final String data = valueKey.value;
|
final ValueKey<String> valueKey =
|
||||||
final int index = unreadMessageList.indexWhere(
|
key as ValueKey<String>;
|
||||||
(element) =>
|
final String data = valueKey.value;
|
||||||
getMessageIdentifier(element, 0) == data);
|
final int index = unreadMessageList.indexWhere(
|
||||||
return index != -1 ? index : null;
|
(element) =>
|
||||||
})),
|
getMessageIdentifier(element, 0) == data);
|
||||||
),
|
return index != -1 ? index : null;
|
||||||
SliverPadding(
|
})),
|
||||||
padding: EdgeInsets.zero,
|
),
|
||||||
key: centerKey,
|
SliverPadding(
|
||||||
),
|
padding: EdgeInsets.zero,
|
||||||
SliverPadding(
|
key: centerKey,
|
||||||
padding: widget.mainHistoryListConfig?.padding ?? EdgeInsets.zero,
|
),
|
||||||
sliver: SliverList(
|
SliverPadding(
|
||||||
delegate: SliverChildBuilderDelegate(
|
padding: widget.mainHistoryListConfig?.padding ?? EdgeInsets.zero,
|
||||||
(BuildContext context, int index) {
|
sliver: SliverList(
|
||||||
final messageItem = readedMessageList[index];
|
delegate: SliverChildBuilderDelegate(
|
||||||
if (index == readedMessageList.length - 1) {
|
(BuildContext context, int index) {
|
||||||
if (widget.model.haveMoreData) {
|
final messageItem = readMessageList[index];
|
||||||
throteFunction(index);
|
if (index == readMessageList.length - 1) {
|
||||||
return Column(
|
if (widget.model.haveMoreData) {
|
||||||
children: [
|
throteFunction(index);
|
||||||
LoadingAnimationWidget.staggeredDotsWave(
|
return Column(
|
||||||
color: theme.weakTextColor ?? Colors.grey,
|
children: [
|
||||||
size: 28,
|
LoadingAnimationWidget.staggeredDotsWave(
|
||||||
),
|
color: theme.weakTextColor ?? Colors.grey,
|
||||||
AutoScrollTag(
|
size: 28,
|
||||||
controller: _autoScrollController,
|
),
|
||||||
index: -index,
|
AutoScrollTag(
|
||||||
key: ValueKey(
|
controller: _autoScrollController,
|
||||||
getMessageIdentifier(messageItem, index)),
|
index: -index,
|
||||||
highlightColor: Colors.black.withOpacity(0.1),
|
key: ValueKey(
|
||||||
child: KeepAliveWrapper(
|
getMessageIdentifier(messageItem, index)),
|
||||||
child: Container(
|
highlightColor: Colors.black.withOpacity(0.1),
|
||||||
padding: const EdgeInsets.symmetric(
|
child: KeepAliveWrapper(
|
||||||
horizontal: 16),
|
child: Container(
|
||||||
child: _getMessageItemBuilder(
|
padding: const EdgeInsets.symmetric(
|
||||||
messageItem))),
|
horizontal: 16),
|
||||||
),
|
child: _getMessageItemBuilder(
|
||||||
],
|
messageItem))),
|
||||||
);
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return AutoScrollTag(
|
||||||
|
controller: _autoScrollController,
|
||||||
|
index: -index,
|
||||||
|
key: ValueKey(
|
||||||
|
getMessageIdentifier(messageItem, index)),
|
||||||
|
highlightColor: Colors.black.withOpacity(0.1),
|
||||||
|
child: KeepAliveWrapper(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16),
|
||||||
|
child: _getMessageItemBuilder(messageItem))),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
childCount: readMessageList.length,
|
||||||
|
findChildIndexCallback: (Key key) {
|
||||||
|
final ValueKey<String> valueKey =
|
||||||
|
key as ValueKey<String>;
|
||||||
|
final String data = valueKey.value;
|
||||||
|
final int index = readMessageList.indexWhere(
|
||||||
|
(element) =>
|
||||||
|
getMessageIdentifier(element, 0) == data);
|
||||||
|
return index > -1 ? index : null;
|
||||||
}
|
}
|
||||||
return AutoScrollTag(
|
)
|
||||||
controller: _autoScrollController,
|
),
|
||||||
index: -index,
|
),
|
||||||
key: ValueKey(
|
],
|
||||||
getMessageIdentifier(messageItem, index)),
|
|
||||||
highlightColor: Colors.black.withOpacity(0.1),
|
|
||||||
child: KeepAliveWrapper(
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 16),
|
|
||||||
child: _getMessageItemBuilder(messageItem))),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
childCount: readedMessageList.length,
|
|
||||||
findChildIndexCallback: (Key key) {
|
|
||||||
final ValueKey<String> valueKey =
|
|
||||||
key as ValueKey<String>;
|
|
||||||
final String data = valueKey.value;
|
|
||||||
final int index = readedMessageList.indexWhere(
|
|
||||||
(element) =>
|
|
||||||
getMessageIdentifier(element, 0) == data);
|
|
||||||
return index != -1 ? index : null;
|
|
||||||
})),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
TIMUIKitHistoryMessageListTongueContainer(
|
|
||||||
model: widget.model,
|
|
||||||
scrollController: _autoScrollController,
|
|
||||||
scrollToIndexBySeq: _onScrollToIndexBySeq,
|
|
||||||
groupAtInfoList: widget.groupAtInfoList,
|
|
||||||
tongueItemBuilder: widget.tongueItemBuilder,
|
|
||||||
),
|
|
||||||
if (loadingPlace == LoadingPlace.top)
|
|
||||||
Positioned(
|
|
||||||
top: 8,
|
|
||||||
child: LoadingAnimationWidget.staggeredDotsWave(
|
|
||||||
color: theme.weakTextColor ?? Colors.grey,
|
|
||||||
size: 28,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
TIMUIKitHistoryMessageListTongueContainer(
|
||||||
|
model: widget.model,
|
||||||
|
scrollController: _autoScrollController,
|
||||||
|
scrollToIndexBySeq: _onScrollToIndexBySeq,
|
||||||
|
groupAtInfoList: widget.groupAtInfoList,
|
||||||
|
tongueItemBuilder: widget.tongueItemBuilder,
|
||||||
|
),
|
||||||
|
if (loadingPlace == LoadingPlace.top)
|
||||||
|
Positioned(
|
||||||
|
top: 8,
|
||||||
|
child: LoadingAnimationWidget.staggeredDotsWave(
|
||||||
|
color: theme.weakTextColor ?? Colors.grey,
|
||||||
|
size: 28,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ class TIMUIKitMessageReactionShowItem extends TIMUIKitStatelessWidget {
|
||||||
right: 10,
|
right: 10,
|
||||||
),
|
),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: Color(0x198a8a8a),
|
color: Color(0x19727271),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
|
||||||
|
|
@ -50,15 +50,19 @@ class _TIMUIKitLastMsgState extends TIMUIKitState<TIMUIKitLastMsg> {
|
||||||
final option1 = isSelf
|
final option1 = isSelf
|
||||||
? TIM_t("您")
|
? TIM_t("您")
|
||||||
: widget.lastMsg!.nickName ?? widget.lastMsg?.sender;
|
: widget.lastMsg!.nickName ?? widget.lastMsg?.sender;
|
||||||
setState(() {
|
if(mounted){
|
||||||
groupTipsAbstractText = TIM_t_para(
|
setState(() {
|
||||||
"{{option1}}撤回了一条消息", "$option1撤回了一条消息")(option1: option1);
|
groupTipsAbstractText = TIM_t_para(
|
||||||
});
|
"{{option1}}撤回了一条消息", "$option1撤回了一条消息")(option1: option1);
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
final newText = await _getLastMsgShowText(widget.lastMsg, widget.context);
|
final newText = await _getLastMsgShowText(widget.lastMsg, widget.context);
|
||||||
setState(() {
|
if(mounted){
|
||||||
groupTipsAbstractText = newText;
|
setState(() {
|
||||||
});
|
groupTipsAbstractText = newText;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_self_info_view_model.dart';
|
||||||
|
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/ui/widgets/image_screen.dart';
|
import 'package:tencent_cloud_chat_uikit/ui/widgets/image_screen.dart';
|
||||||
import 'package:tencent_im_base/tencent_im_base.dart';
|
import 'package:tencent_im_base/tencent_im_base.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_statelesswidget.dart';
|
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_statelesswidget.dart';
|
||||||
|
|
@ -16,6 +18,8 @@ class Avatar extends TIMUIKitStatelessWidget {
|
||||||
final V2TimUserStatus? onlineStatus;
|
final V2TimUserStatus? onlineStatus;
|
||||||
final int? type; // 1 c2c 2 group
|
final int? type; // 1 c2c 2 group
|
||||||
final bool isShowBigWhenClick;
|
final bool isShowBigWhenClick;
|
||||||
|
final TUISelfInfoViewModel selfInfoViewModel =
|
||||||
|
serviceLocator<TUISelfInfoViewModel>();
|
||||||
|
|
||||||
Avatar(
|
Avatar(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
|
|
@ -31,11 +35,23 @@ class Avatar extends TIMUIKitStatelessWidget {
|
||||||
Widget getImageWidget(BuildContext context, TUITheme theme) {
|
Widget getImageWidget(BuildContext context, TUITheme theme) {
|
||||||
Widget defaultAvatar() {
|
Widget defaultAvatar() {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
return Image.asset('images/default_c2c_head.png',
|
return Image.asset(
|
||||||
package: 'tencent_cloud_chat_uikit');
|
TencentUtils.checkString(
|
||||||
|
selfInfoViewModel.globalConfig?.defaultAvatarAssetPath) ??
|
||||||
|
'images/default_c2c_head.png',
|
||||||
|
package:
|
||||||
|
selfInfoViewModel.globalConfig?.defaultAvatarAssetPath != null
|
||||||
|
? null
|
||||||
|
: 'tencent_cloud_chat_uikit');
|
||||||
} else {
|
} else {
|
||||||
return Image.asset('images/default_group_head.png',
|
return Image.asset(
|
||||||
package: 'tencent_cloud_chat_uikit');
|
TencentUtils.checkString(
|
||||||
|
selfInfoViewModel.globalConfig?.defaultAvatarAssetPath) ??
|
||||||
|
'images/default_group_head.png',
|
||||||
|
package:
|
||||||
|
selfInfoViewModel.globalConfig?.defaultAvatarAssetPath != null
|
||||||
|
? null
|
||||||
|
: 'tencent_cloud_chat_uikit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,12 +75,26 @@ class Avatar extends TIMUIKitStatelessWidget {
|
||||||
ImageProvider getImageProvider() {
|
ImageProvider getImageProvider() {
|
||||||
ImageProvider defaultAvatar() {
|
ImageProvider defaultAvatar() {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
return Image.asset('images/default_c2c_head.png',
|
return Image.asset(
|
||||||
package: 'tencent_cloud_chat_uikit')
|
TencentUtils.checkString(selfInfoViewModel
|
||||||
|
.globalConfig?.defaultAvatarAssetPath) ??
|
||||||
|
'images/default_c2c_head.png',
|
||||||
|
package:
|
||||||
|
selfInfoViewModel.globalConfig?.defaultAvatarAssetPath !=
|
||||||
|
null
|
||||||
|
? null
|
||||||
|
: 'tencent_cloud_chat_uikit')
|
||||||
.image;
|
.image;
|
||||||
} else {
|
} else {
|
||||||
return Image.asset('images/default_group_head.png',
|
return Image.asset(
|
||||||
package: 'tencent_cloud_chat_uikit')
|
TencentUtils.checkString(selfInfoViewModel
|
||||||
|
.globalConfig?.defaultAvatarAssetPath) ??
|
||||||
|
'images/default_group_head.png',
|
||||||
|
package:
|
||||||
|
selfInfoViewModel.globalConfig?.defaultAvatarAssetPath !=
|
||||||
|
null
|
||||||
|
? null
|
||||||
|
: 'tencent_cloud_chat_uikit')
|
||||||
.image;
|
.image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
738
pubspec.lock
738
pubspec.lock
File diff suppressed because it is too large
Load Diff
|
|
@ -1,8 +1,8 @@
|
||||||
name: tencent_cloud_chat_uikit
|
name: tencent_cloud_chat_uikit
|
||||||
description: UI components library and basic chat business logic for Tencent Cloud Chat service, helping you build In-APP Chat module easily.
|
description: Chat UI components library and basic chat business logic for Tencent Cloud Chat, helping you build In-APP Chat module easily.
|
||||||
version: 1.4.0
|
version: 1.5.0
|
||||||
homepage: https://www.tencentcloud.com/products/im?from=pub
|
homepage: https://www.tencentcloud.com/products/im?from=pub
|
||||||
repository: https://github.com/TencentCloud/tc-chat-uikit-flutter
|
repository: https://github.com/TencentCloud/chat-uikit-flutter
|
||||||
documentation: https://comm.qq.com/im/doc/flutter/en/TUIKit/readme.html
|
documentation: https://comm.qq.com/im/doc/flutter/en/TUIKit/readme.html
|
||||||
# publish_to: none
|
# publish_to: none
|
||||||
platforms:
|
platforms:
|
||||||
|
|
@ -62,7 +62,7 @@ dependencies:
|
||||||
url_launcher: ^6.1.4
|
url_launcher: ^6.1.4
|
||||||
universal_html: ^2.0.8
|
universal_html: ^2.0.8
|
||||||
link_preview_generator: ^1.2.0
|
link_preview_generator: ^1.2.0
|
||||||
tencent_im_base: ^1.0.19
|
tencent_im_base: ^1.0.20
|
||||||
disk_space: ^0.2.1
|
disk_space: ^0.2.1
|
||||||
http: ^0.13.5
|
http: ^0.13.5
|
||||||
crypto: ^3.0.2
|
crypto: ^3.0.2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue