update flutter uikit to 1.5.0+1
This commit is contained in:
parent
78bea5cef9
commit
7f3360ead1
|
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
## 1.5.0+1
|
||||||
|
|
||||||
|
* Fix: Video message oversize.
|
||||||
|
|
||||||
## 1.5.0
|
## 1.5.0
|
||||||
|
|
||||||
* Add: New configuration `defaultAvatarAssetPath` on global `TIMUIKitConfig`, aiming to define the default avatar.
|
* Add: New configuration `defaultAvatarAssetPath` on global `TIMUIKitConfig`, aiming to define the default avatar.
|
||||||
|
|
|
||||||
|
|
@ -379,14 +379,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.15"
|
version: "0.0.15"
|
||||||
flutter_screenutil:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: flutter_screenutil
|
|
||||||
sha256: "8e049ecdc1a62c90e6bf0e9c8398ace8dde81b92889c70cfe06281d79d59113a"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "5.6.1"
|
|
||||||
flutter_slidable_for_tencent_im:
|
flutter_slidable_for_tencent_im:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1088,7 +1080,7 @@ packages:
|
||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "1.4.0"
|
version: "1.5.0+1"
|
||||||
tencent_extended_text:
|
tencent_extended_text:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1117,10 +1109,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: tencent_im_base
|
name: tencent_im_base
|
||||||
sha256: "2c8fd0f47d6b22d234f24042c5ac66febe6d71b7c9e131c95031e931efe9aa7b"
|
sha256: bbd2d70c82b018ce86c421f0b4eb02f650456d0bbd7ea5558110139c7b04c4b4
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.20"
|
version: "1.0.21"
|
||||||
tencent_im_sdk_plugin_platform_interface:
|
tencent_im_sdk_plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -354,7 +354,7 @@ class _TIMUIKitHistoryMessageListState
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
color: theme.chatBgColor,
|
color: theme.chatBgColor ,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
children: [
|
children: [
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import 'dart:typed_data';
|
||||||
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:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
import 'package:loading_animation_widget/loading_animation_widget.dart';
|
import 'package:loading_animation_widget/loading_animation_widget.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
@ -230,15 +229,6 @@ class _TIMUIKitImageElem extends TIMUIKitState<TIMUIKitImageElem> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getImgWidthAndHeight(
|
|
||||||
BoxConstraints constraints, double height, double width) {
|
|
||||||
// 消息列表展示缩略图的大小
|
|
||||||
double hwrate = height / width;
|
|
||||||
double curWidth = min(width, constraints.maxWidth * 0.5);
|
|
||||||
double curHeight = curWidth * hwrate;
|
|
||||||
return {height: curHeight, width: curWidth};
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _saveImg(TUITheme theme) async {
|
Future<void> _saveImg(TUITheme theme) async {
|
||||||
String? path = widget.message.imageElem!.path;
|
String? path = widget.message.imageElem!.path;
|
||||||
if (path != null && PlatformUtils().isWeb
|
if (path != null && PlatformUtils().isWeb
|
||||||
|
|
|
||||||
|
|
@ -99,10 +99,12 @@ class _TIMUIKitSoundElemState extends TIMUIKitState<TIMUIKitSoundElem> {
|
||||||
widget.message.soundElem!.url == '') {
|
widget.message.soundElem!.url == '') {
|
||||||
final response = await _messageService.getMessageOnlineUrl(
|
final response = await _messageService.getMessageOnlineUrl(
|
||||||
msgID: widget.message.msgID!);
|
msgID: widget.message.msgID!);
|
||||||
widget.message.soundElem = response.data!.soundElem;
|
if(response.data != null){
|
||||||
Future.delayed(const Duration(microseconds: 10), () {
|
widget.message.soundElem = response.data!.soundElem;
|
||||||
setState(() => stateElement = response.data!.soundElem!);
|
Future.delayed(const Duration(microseconds: 10), () {
|
||||||
});
|
setState(() => stateElement = response.data!.soundElem!);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!PlatformUtils().isWeb) {
|
if (!PlatformUtils().isWeb) {
|
||||||
if (widget.message.soundElem!.localUrl == null ||
|
if (widget.message.soundElem!.localUrl == null ||
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
import 'package:loading_animation_widget/loading_animation_widget.dart';
|
import 'package:loading_animation_widget/loading_animation_widget.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
|
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_state.dart';
|
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_state.dart';
|
||||||
|
|
@ -134,10 +133,12 @@ class _TIMUIKitVideoElemState extends TIMUIKitState<TIMUIKitVideoElem> {
|
||||||
widget.message.videoElem!.videoUrl == '') {
|
widget.message.videoElem!.videoUrl == '') {
|
||||||
final response = await _messageService.getMessageOnlineUrl(
|
final response = await _messageService.getMessageOnlineUrl(
|
||||||
msgID: widget.message.msgID!);
|
msgID: widget.message.msgID!);
|
||||||
widget.message.videoElem = response.data!.videoElem;
|
if(response.data != null){
|
||||||
Future.delayed(const Duration(microseconds: 10), () {
|
widget.message.videoElem = response.data!.videoElem;
|
||||||
setState(() => stateElement = response.data!.videoElem!);
|
Future.delayed(const Duration(microseconds: 10), () {
|
||||||
});
|
setState(() => stateElement = response.data!.videoElem!);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!PlatformUtils().isWeb) {
|
if (!PlatformUtils().isWeb) {
|
||||||
if (widget.message.videoElem!.localVideoUrl == null ||
|
if (widget.message.videoElem!.localVideoUrl == null ||
|
||||||
|
|
@ -185,95 +186,83 @@ class _TIMUIKitVideoElemState extends TIMUIKitState<TIMUIKitVideoElem> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: ScreenUtilInit(
|
child: Hero(
|
||||||
builder: (BuildContext context, Widget? child) {
|
tag: heroTag,
|
||||||
return Hero(
|
child: TIMUIKitMessageReactionWrapper(
|
||||||
tag: heroTag,
|
chatModel: widget.chatModel,
|
||||||
child: TIMUIKitMessageReactionWrapper(
|
message: widget.message,
|
||||||
chatModel: widget.chatModel,
|
isShowJump: widget.isShowJump,
|
||||||
message: widget.message,
|
isShowMessageReaction: widget.isShowMessageReaction ?? true,
|
||||||
isShowJump: widget.isShowJump,
|
clearJump: widget.clearJump,
|
||||||
isShowMessageReaction: widget.isShowMessageReaction ?? true,
|
isFromSelf: widget.message.isSelf ?? true,
|
||||||
clearJump: widget.clearJump,
|
child: ClipRRect(
|
||||||
isFromSelf: widget.message.isSelf ?? true,
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
||||||
child: ClipRRect(
|
child: LayoutBuilder(builder:
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
(BuildContext context, BoxConstraints constraints) {
|
||||||
child: LayoutBuilder(builder:
|
double positionRadio = 0.56;
|
||||||
(BuildContext context, BoxConstraints constraints) {
|
if (stateElement.snapshotWidth != null &&
|
||||||
double positionRadio = 0.56;
|
stateElement.snapshotHeight != null &&
|
||||||
if (stateElement.snapshotWidth != null &&
|
stateElement.snapshotWidth != 0 &&
|
||||||
stateElement.snapshotHeight != null &&
|
stateElement.snapshotHeight != 0) {
|
||||||
stateElement.snapshotWidth != 0 &&
|
positionRadio = (stateElement.snapshotWidth! /
|
||||||
stateElement.snapshotHeight != 0) {
|
stateElement.snapshotHeight!);
|
||||||
positionRadio = (stateElement.snapshotWidth! /
|
}
|
||||||
stateElement.snapshotHeight!);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ConstrainedBox(
|
return ConstrainedBox(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth: PlatformUtils().isWeb
|
maxWidth: PlatformUtils().isWeb
|
||||||
? 300
|
? 300
|
||||||
: constraints.maxWidth * 0.5,
|
: constraints.maxWidth * 0.5,
|
||||||
maxHeight: min(constraints.maxHeight * 0.8, 300),
|
maxHeight: min(constraints.maxHeight * 0.8, 300),
|
||||||
minHeight: 20,
|
minHeight: 20,
|
||||||
minWidth: 20),
|
minWidth: 20),
|
||||||
child: AspectRatio(
|
child: AspectRatio(
|
||||||
aspectRatio: positionRadio,
|
aspectRatio: positionRadio,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (stateElement.snapshotUrl != null ||
|
Row(
|
||||||
stateElement.snapshotUrl != null)
|
children: [
|
||||||
AspectRatio(
|
Expanded(
|
||||||
aspectRatio: positionRadio,
|
child: generateSnapshot(
|
||||||
child: Container(
|
theme,
|
||||||
decoration: const BoxDecoration(
|
stateElement.snapshotHeight ??
|
||||||
color: Colors.transparent),
|
100))
|
||||||
),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: generateSnapshot(
|
|
||||||
theme,
|
|
||||||
stateElement.snapshotHeight ??
|
|
||||||
100))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
if (widget.message.status !=
|
|
||||||
MessageStatus
|
|
||||||
.V2TIM_MSG_STATUS_SENDING &&
|
|
||||||
(stateElement.snapshotUrl != null ||
|
|
||||||
stateElement.snapshotPath !=
|
|
||||||
null) &&
|
|
||||||
stateElement.videoPath != null ||
|
|
||||||
stateElement.videoUrl != null)
|
|
||||||
Positioned.fill(
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
child: Center(
|
|
||||||
child: Image.asset('images/play.png',
|
|
||||||
package: 'tencent_cloud_chat_uikit',
|
|
||||||
height: 64)),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
right: 10,
|
|
||||||
bottom: 10,
|
|
||||||
child: Text(
|
|
||||||
MessageUtils.formatVideoTime(widget
|
|
||||||
.message
|
|
||||||
.videoElem
|
|
||||||
?.duration ??
|
|
||||||
0)
|
|
||||||
.toString(),
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 12))),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
if (widget.message.status !=
|
||||||
}),
|
MessageStatus
|
||||||
)));
|
.V2TIM_MSG_STATUS_SENDING &&
|
||||||
},
|
(stateElement.snapshotUrl != null ||
|
||||||
),
|
stateElement.snapshotPath !=
|
||||||
|
null) &&
|
||||||
|
stateElement.videoPath != null ||
|
||||||
|
stateElement.videoUrl != null)
|
||||||
|
Positioned.fill(
|
||||||
|
// alignment: Alignment.center,
|
||||||
|
child: Center(
|
||||||
|
child: Image.asset('images/play.png',
|
||||||
|
package: 'tencent_cloud_chat_uikit',
|
||||||
|
height: 64)),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
right: 10,
|
||||||
|
bottom: 10,
|
||||||
|
child: Text(
|
||||||
|
MessageUtils.formatVideoTime(widget
|
||||||
|
.message
|
||||||
|
.videoElem
|
||||||
|
?.duration ??
|
||||||
|
0)
|
||||||
|
.toString(),
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12))),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
))),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
pubspec.lock
12
pubspec.lock
|
|
@ -443,14 +443,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.15"
|
version: "0.0.15"
|
||||||
flutter_screenutil:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_screenutil
|
|
||||||
sha256: "8e049ecdc1a62c90e6bf0e9c8398ace8dde81b92889c70cfe06281d79d59113a"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "5.6.1"
|
|
||||||
flutter_slidable_for_tencent_im:
|
flutter_slidable_for_tencent_im:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -1225,10 +1217,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: tencent_im_base
|
name: tencent_im_base
|
||||||
sha256: "2c8fd0f47d6b22d234f24042c5ac66febe6d71b7c9e131c95031e931efe9aa7b"
|
sha256: bbd2d70c82b018ce86c421f0b4eb02f650456d0bbd7ea5558110139c7b04c4b4
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.20"
|
version: "1.0.21"
|
||||||
tencent_im_sdk_plugin_platform_interface:
|
tencent_im_sdk_plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name: tencent_cloud_chat_uikit
|
name: tencent_cloud_chat_uikit
|
||||||
description: Chat UI components library and basic chat business logic for Tencent Cloud Chat, 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.5.0
|
version: 1.5.0+1
|
||||||
homepage: https://www.tencentcloud.com/products/im?from=pub
|
homepage: https://www.tencentcloud.com/products/im?from=pub
|
||||||
repository: https://github.com/TencentCloud/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
|
||||||
|
|
@ -57,12 +57,11 @@ dependencies:
|
||||||
loading_animation_widget: ^1.1.0+3
|
loading_animation_widget: ^1.1.0+3
|
||||||
permission_handler: ^10.0.0
|
permission_handler: ^10.0.0
|
||||||
tuple: ^2.0.0
|
tuple: ^2.0.0
|
||||||
flutter_screenutil: ^5.5.3+2
|
|
||||||
flutter_markdown: ^0.6.9
|
flutter_markdown: ^0.6.9
|
||||||
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.20
|
tencent_im_base: ^1.0.21
|
||||||
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