fix: replace broken SVG icons with official SDK versions and fix sync script bug
- Replace images/photo.svg with images/svg/send_image.svg - Replace images/file.svg with images/svg/send_file.svg - Fix critical bug in sync_from_upstream.sh: now correctly preserves protected paths by using pre-merge commit - Update LOCAL_CHANGES.md with detailed documentation
This commit is contained in:
parent
ae6d2f4b6a
commit
46142714c9
|
|
@ -26,6 +26,21 @@
|
||||||
* `Positioned` 底部距离从 `20` 调整为 `50`。
|
* `Positioned` 底部距离从 `20` 调整为 `50`。
|
||||||
* `Positioned` 左右距离从 `20` 调整为 `10`。
|
* `Positioned` 左右距离从 `20` 调整为 `10`。
|
||||||
|
|
||||||
|
### `lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_more_panel.dart`
|
||||||
|
* **修改日期**: 2026-01-05
|
||||||
|
* **修改目的**: 修复底部"照片"、"文件"图标显示为纯黑色的问题。
|
||||||
|
* **详细改动**:
|
||||||
|
* 将本地 `images/photo.svg` 替换为官方 SDK 的 `images/svg/send_image.svg`。
|
||||||
|
* 将本地 `images/file.svg` 替换为官方 SDK 的 `images/svg/send_file.svg`。
|
||||||
|
* **原因**: 在上游同步时,本地 SVG 文件被覆盖为缺少 `fill` 属性的版本,导致渲染为黑色。
|
||||||
|
|
||||||
|
### `scripts/sync_from_upstream.sh`
|
||||||
|
* **修改日期**: 2026-01-05
|
||||||
|
* **修改目的**: 修复同步脚本的关键 bug,确保 `images/` 真正被保护。
|
||||||
|
* **详细改动**:
|
||||||
|
* 在合并前保存 master 的 commit hash (`MASTER_BEFORE_MERGE`)。
|
||||||
|
* 在恢复保护路径时使用保存的 commit,而非 `HEAD`(`HEAD` 在合并后已被污染)。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3. 维护指南 (Maintenance Guide)
|
## 3. 维护指南 (Maintenance Guide)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,8 @@ class MorePanelItem {
|
||||||
final Widget icon;
|
final Widget icon;
|
||||||
final Function(BuildContext context)? onTap;
|
final Function(BuildContext context)? onTap;
|
||||||
|
|
||||||
MorePanelItem({this.onTap, required this.icon, required this.id, required this.title});
|
MorePanelItem(
|
||||||
|
{this.onTap, required this.icon, required this.id, required this.title});
|
||||||
}
|
}
|
||||||
|
|
||||||
class MorePanel extends StatefulWidget {
|
class MorePanel extends StatefulWidget {
|
||||||
|
|
@ -84,7 +85,11 @@ class MorePanel extends StatefulWidget {
|
||||||
|
|
||||||
final MorePanelConfig? morePanelConfig;
|
final MorePanelConfig? morePanelConfig;
|
||||||
|
|
||||||
const MorePanel({required this.conversationID, required this.conversationType, Key? key, this.morePanelConfig})
|
const MorePanel(
|
||||||
|
{required this.conversationID,
|
||||||
|
required this.conversationType,
|
||||||
|
Key? key,
|
||||||
|
this.morePanelConfig})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -93,7 +98,8 @@ class MorePanel extends StatefulWidget {
|
||||||
|
|
||||||
class _MorePanelState extends TIMUIKitState<MorePanel> {
|
class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
final ImagePicker _picker = ImagePicker();
|
final ImagePicker _picker = ImagePicker();
|
||||||
final TUISelfInfoViewModel _selfInfoViewModel = serviceLocator<TUISelfInfoViewModel>();
|
final TUISelfInfoViewModel _selfInfoViewModel =
|
||||||
|
serviceLocator<TUISelfInfoViewModel>();
|
||||||
Uint8List? fileContent;
|
Uint8List? fileContent;
|
||||||
String? fileName;
|
String? fileName;
|
||||||
File? tempFile;
|
File? tempFile;
|
||||||
|
|
@ -114,7 +120,8 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
isInstallCallkit = value;
|
isInstallCallkit = value;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
_betterPlayerController = BetterPlayerController(const BetterPlayerConfiguration());
|
_betterPlayerController =
|
||||||
|
BetterPlayerController(const BetterPlayerConfiguration());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,9 +144,11 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
"images/photo.svg",
|
"images/svg/send_image.svg",
|
||||||
package: 'tencent_cloud_chat_uikit',
|
package: 'tencent_cloud_chat_uikit',
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
|
|
@ -156,7 +165,9 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
"images/screen.svg",
|
"images/screen.svg",
|
||||||
package: 'tencent_cloud_chat_uikit',
|
package: 'tencent_cloud_chat_uikit',
|
||||||
|
|
@ -175,7 +186,9 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
"images/take_video.png",
|
"images/take_video.png",
|
||||||
package: 'tencent_cloud_chat_uikit',
|
package: 'tencent_cloud_chat_uikit',
|
||||||
|
|
@ -199,9 +212,11 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
"images/photo.svg",
|
"images/svg/send_image.svg",
|
||||||
package: 'tencent_cloud_chat_uikit',
|
package: 'tencent_cloud_chat_uikit',
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
|
|
@ -223,8 +238,11 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
child: Icon(Icons.video_file, color: hexToColor("5c6168"), size: 26),
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||||
|
child:
|
||||||
|
Icon(Icons.video_file, color: hexToColor("5c6168"), size: 26),
|
||||||
)),
|
)),
|
||||||
MorePanelItem(
|
MorePanelItem(
|
||||||
id: "file",
|
id: "file",
|
||||||
|
|
@ -241,9 +259,11 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
"images/file.svg",
|
"images/svg/send_file.svg",
|
||||||
package: 'tencent_cloud_chat_uikit',
|
package: 'tencent_cloud_chat_uikit',
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
|
|
@ -265,7 +285,9 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
"images/video-call.svg",
|
"images/video-call.svg",
|
||||||
package: 'tencent_cloud_chat_uikit',
|
package: 'tencent_cloud_chat_uikit',
|
||||||
|
|
@ -289,7 +311,9 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
"images/voice-call.svg",
|
"images/voice-call.svg",
|
||||||
package: 'tencent_cloud_chat_uikit',
|
package: 'tencent_cloud_chat_uikit',
|
||||||
|
|
@ -328,9 +352,11 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendVideoMessage(String originFilePath, int duration, int size, TUIChatSeparateViewModel model) async {
|
_sendVideoMessage(String originFilePath, int duration, int size,
|
||||||
|
TUIChatSeparateViewModel model) async {
|
||||||
if (size >= MorePanelConfig.VIDEO_MAX_SIZE) {
|
if (size >= MorePanelConfig.VIDEO_MAX_SIZE) {
|
||||||
onTIMCallback(TIMCallback(type: TIMCallbackType.INFO, infoRecommendText: TIM_t("文件大小超出了限制")));
|
onTIMCallback(TIMCallback(
|
||||||
|
type: TIMCallbackType.INFO, infoRecommendText: TIM_t("文件大小超出了限制")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -339,7 +365,9 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
final convID = widget.conversationID;
|
final convID = widget.conversationID;
|
||||||
final convType = widget.conversationType;
|
final convType = widget.conversationType;
|
||||||
|
|
||||||
String tempPath = (await getTemporaryDirectory()).path + p.basename(originFilePath) + ".jpeg";
|
String tempPath = (await getTemporaryDirectory()).path +
|
||||||
|
p.basename(originFilePath) +
|
||||||
|
".jpeg";
|
||||||
|
|
||||||
await plugin.getVideoThumbnail(
|
await plugin.getVideoThumbnail(
|
||||||
srcFile: originFilePath,
|
srcFile: originFilePath,
|
||||||
|
|
@ -351,7 +379,11 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
);
|
);
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendVideoMessage(
|
model.sendVideoMessage(
|
||||||
videoPath: originFilePath, duration: duration, snapshotPath: tempPath, convID: convID, convType: convType),
|
videoPath: originFilePath,
|
||||||
|
duration: duration,
|
||||||
|
snapshotPath: tempPath,
|
||||||
|
convID: convID,
|
||||||
|
convType: convType),
|
||||||
context);
|
context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -411,34 +443,47 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
if (filePath != null) {
|
if (filePath != null) {
|
||||||
if (type == AssetType.image) {
|
if (type == AssetType.image) {
|
||||||
if (size >= MorePanelConfig.IMAGE_MAX_SIZE) {
|
if (size >= MorePanelConfig.IMAGE_MAX_SIZE) {
|
||||||
onTIMCallback(TIMCallback(type: TIMCallbackType.INFO, infoRecommendText: TIM_t("文件大小超出了限制")));
|
onTIMCallback(TIMCallback(
|
||||||
|
type: TIMCallbackType.INFO,
|
||||||
|
infoRecommendText: TIM_t("文件大小超出了限制")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendImageMessage(imagePath: filePath, convID: convID, convType: convType), context);
|
model.sendImageMessage(
|
||||||
|
imagePath: filePath,
|
||||||
|
convID: convID,
|
||||||
|
convType: convType),
|
||||||
|
context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == AssetType.video) {
|
if (type == AssetType.video) {
|
||||||
_sendVideoMessage(originFile!.path, asset.videoDuration.inSeconds, size, model);
|
_sendVideoMessage(originFile!.path,
|
||||||
|
asset.videoDuration.inSeconds, size, model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FilePickerResult? result = await FilePicker.platform.pickFiles(type: FileType.media);
|
FilePickerResult? result =
|
||||||
|
await FilePicker.platform.pickFiles(type: FileType.media);
|
||||||
if (result != null && result.files.isNotEmpty) {
|
if (result != null && result.files.isNotEmpty) {
|
||||||
File file = File(result.files.single.path!);
|
File file = File(result.files.single.path!);
|
||||||
final String savePath = file.path;
|
final String savePath = file.path;
|
||||||
final String type =
|
final String type = TencentUtils.getFileType(
|
||||||
TencentUtils.getFileType(savePath.split(".")[savePath.split(".").length - 1]).split("/")[0];
|
savePath.split(".")[savePath.split(".").length - 1])
|
||||||
|
.split("/")[0];
|
||||||
|
|
||||||
if (type == "image") {
|
if (type == "image") {
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendImageMessage(imagePath: savePath, convID: convID, convType: convType), context);
|
model.sendImageMessage(
|
||||||
|
imagePath: savePath, convID: convID, convType: convType),
|
||||||
|
context);
|
||||||
} else if (type == "video") {
|
} else if (type == "video") {
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendVideoMessage(videoPath: savePath, convID: convID, convType: convType), context);
|
model.sendVideoMessage(
|
||||||
|
videoPath: savePath, convID: convID, convType: convType),
|
||||||
|
context);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw TypeError();
|
throw TypeError();
|
||||||
|
|
@ -449,7 +494,8 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendImageFromCamera(TUIChatSeparateViewModel model, TUITheme theme, {required isVideo}) async {
|
_sendImageFromCamera(TUIChatSeparateViewModel model, TUITheme theme,
|
||||||
|
{required isVideo}) async {
|
||||||
try {
|
try {
|
||||||
if (!await Permissions.checkPermission(
|
if (!await Permissions.checkPermission(
|
||||||
context,
|
context,
|
||||||
|
|
@ -476,18 +522,25 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
final size = await originFile!.length();
|
final size = await originFile!.length();
|
||||||
if (!isVideo) {
|
if (!isVideo) {
|
||||||
if (size >= MorePanelConfig.IMAGE_MAX_SIZE) {
|
if (size >= MorePanelConfig.IMAGE_MAX_SIZE) {
|
||||||
onTIMCallback(TIMCallback(type: TIMCallbackType.INFO, infoRecommendText: TIM_t("文件大小超出了限制")));
|
onTIMCallback(TIMCallback(
|
||||||
|
type: TIMCallbackType.INFO,
|
||||||
|
infoRecommendText: TIM_t("文件大小超出了限制")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendImageMessage(imagePath: originFile.path, convID: convID, convType: convType), context);
|
model.sendImageMessage(
|
||||||
|
imagePath: originFile.path, convID: convID, convType: convType),
|
||||||
|
context);
|
||||||
} else {
|
} else {
|
||||||
// 监听视频准备完成事件
|
// 监听视频准备完成事件
|
||||||
_betterPlayerController.addEventsListener((event) {
|
_betterPlayerController.addEventsListener((event) {
|
||||||
if (event.betterPlayerEventType == BetterPlayerEventType.initialized) {
|
if (event.betterPlayerEventType ==
|
||||||
|
BetterPlayerEventType.initialized) {
|
||||||
// 获取视频时长(单位:秒)
|
// 获取视频时长(单位:秒)
|
||||||
int durationInSeconds = _betterPlayerController.videoPlayerController?.value.duration?.inSeconds ?? 0;
|
int durationInSeconds = _betterPlayerController
|
||||||
|
.videoPlayerController?.value.duration?.inSeconds ??
|
||||||
|
0;
|
||||||
_sendVideoMessage(originFile!.path, durationInSeconds, size, model);
|
_sendVideoMessage(originFile!.path, durationInSeconds, size, model);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -514,12 +567,17 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
fileContent = imageContent;
|
fileContent = imageContent;
|
||||||
|
|
||||||
html.Node? inputElem;
|
html.Node? inputElem;
|
||||||
inputElem = html.document.getElementById("__image_picker_web-file-input")?.querySelector("input");
|
inputElem = html.document
|
||||||
|
.getElementById("__image_picker_web-file-input")
|
||||||
|
?.querySelector("input");
|
||||||
final convID = widget.conversationID;
|
final convID = widget.conversationID;
|
||||||
final convType = widget.conversationType;
|
final convType = widget.conversationType;
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendImageMessage(
|
model.sendImageMessage(
|
||||||
inputElement: inputElem, imagePath: tempFile?.path, convID: convID, convType: convType),
|
inputElement: inputElem,
|
||||||
|
imagePath: tempFile?.path,
|
||||||
|
convID: convID,
|
||||||
|
convType: convType),
|
||||||
context);
|
context);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
outputLogger.i("_sendFileErr: ${e.toString()}");
|
outputLogger.i("_sendFileErr: ${e.toString()}");
|
||||||
|
|
@ -535,18 +593,25 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
fileContent = videoContent;
|
fileContent = videoContent;
|
||||||
|
|
||||||
if (fileName!.split(".")[fileName!.split(".").length - 1] != "mp4") {
|
if (fileName!.split(".")[fileName!.split(".").length - 1] != "mp4") {
|
||||||
onTIMCallback(
|
onTIMCallback(TIMCallback(
|
||||||
TIMCallback(type: TIMCallbackType.INFO, infoRecommendText: TIM_t("视频消息仅限 mp4 格式"), infoCode: 6660412));
|
type: TIMCallbackType.INFO,
|
||||||
|
infoRecommendText: TIM_t("视频消息仅限 mp4 格式"),
|
||||||
|
infoCode: 6660412));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
html.Node? inputElem;
|
html.Node? inputElem;
|
||||||
inputElem = html.document.getElementById("__image_picker_web-file-input")?.querySelector("input");
|
inputElem = html.document
|
||||||
|
.getElementById("__image_picker_web-file-input")
|
||||||
|
?.querySelector("input");
|
||||||
final convID = widget.conversationID;
|
final convID = widget.conversationID;
|
||||||
final convType = widget.conversationType;
|
final convType = widget.conversationType;
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendVideoMessage(
|
model.sendVideoMessage(
|
||||||
inputElement: inputElem, videoPath: tempFile?.path, convID: convID, convType: convType),
|
inputElement: inputElem,
|
||||||
|
videoPath: tempFile?.path,
|
||||||
|
convID: convID,
|
||||||
|
convType: convType),
|
||||||
context);
|
context);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
outputLogger.i("_sendFileErr: ${e.toString()}");
|
outputLogger.i("_sendFileErr: ${e.toString()}");
|
||||||
|
|
@ -564,29 +629,43 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
if (result != null && result.files.isNotEmpty) {
|
if (result != null && result.files.isNotEmpty) {
|
||||||
if (PlatformUtils().isWeb) {
|
if (PlatformUtils().isWeb) {
|
||||||
html.Node? inputElem;
|
html.Node? inputElem;
|
||||||
inputElem = html.document.getElementById("__file_picker_web-file-input")?.querySelector("input");
|
inputElem = html.document
|
||||||
|
.getElementById("__file_picker_web-file-input")
|
||||||
|
?.querySelector("input");
|
||||||
fileName = result.files.single.name;
|
fileName = result.files.single.name;
|
||||||
|
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendFileMessage(inputElement: inputElem, fileName: fileName, convID: convID, convType: convType),
|
model.sendFileMessage(
|
||||||
|
inputElement: inputElem,
|
||||||
|
fileName: fileName,
|
||||||
|
convID: convID,
|
||||||
|
convType: convType),
|
||||||
context);
|
context);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String? option2 = result.files.single.path ?? "";
|
String? option2 = result.files.single.path ?? "";
|
||||||
outputLogger.i(TIM_t_para("选择成功{{option2}}", "选择成功$option2")(option2: option2));
|
outputLogger
|
||||||
|
.i(TIM_t_para("选择成功{{option2}}", "选择成功$option2")(option2: option2));
|
||||||
|
|
||||||
File file = File(result.files.single.path!);
|
File file = File(result.files.single.path!);
|
||||||
final int size = file.lengthSync();
|
final int size = file.lengthSync();
|
||||||
if (size >= MorePanelConfig.FILE_MAX_SIZE) {
|
if (size >= MorePanelConfig.FILE_MAX_SIZE) {
|
||||||
onTIMCallback(TIMCallback(type: TIMCallbackType.INFO, infoRecommendText: TIM_t("文件大小超出了限制")));
|
onTIMCallback(TIMCallback(
|
||||||
|
type: TIMCallbackType.INFO,
|
||||||
|
infoRecommendText: TIM_t("文件大小超出了限制")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String savePath = file.path;
|
final String savePath = file.path;
|
||||||
|
|
||||||
MessageUtils.handleMessageError(
|
MessageUtils.handleMessageError(
|
||||||
model.sendFileMessage(filePath: savePath, size: size, convID: convID, convType: convType), context);
|
model.sendFileMessage(
|
||||||
|
filePath: savePath,
|
||||||
|
size: size,
|
||||||
|
convID: convID,
|
||||||
|
convType: convType),
|
||||||
|
context);
|
||||||
} else {
|
} else {
|
||||||
throw TypeError();
|
throw TypeError();
|
||||||
}
|
}
|
||||||
|
|
@ -636,13 +715,16 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
bool hasCameraPermission = false;
|
bool hasCameraPermission = false;
|
||||||
bool hasMicrophonePermission = false;
|
bool hasMicrophonePermission = false;
|
||||||
if (type == TYPE_VIDEO) {
|
if (type == TYPE_VIDEO) {
|
||||||
hasCameraPermission = await Permissions.checkPermission(context, Permission.camera.value);
|
hasCameraPermission =
|
||||||
hasMicrophonePermission = await Permissions.checkPermission(context, Permission.microphone.value);
|
await Permissions.checkPermission(context, Permission.camera.value);
|
||||||
|
hasMicrophonePermission = await Permissions.checkPermission(
|
||||||
|
context, Permission.microphone.value);
|
||||||
if (!hasCameraPermission || !hasMicrophonePermission) {
|
if (!hasCameraPermission || !hasMicrophonePermission) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hasMicrophonePermission = await Permissions.checkPermission(context, Permission.microphone.value);
|
hasMicrophonePermission = await Permissions.checkPermission(
|
||||||
|
context, Permission.microphone.value);
|
||||||
if (!hasMicrophonePermission) {
|
if (!hasMicrophonePermission) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -664,7 +746,9 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
_tUICore.callService(TUICALLKIT_SERVICE_NAME, METHOD_NAME_CALL, {
|
_tUICore.callService(TUICALLKIT_SERVICE_NAME, METHOD_NAME_CALL, {
|
||||||
PARAM_NAME_TYPE: type,
|
PARAM_NAME_TYPE: type,
|
||||||
PARAM_NAME_USERIDS: inviteMember,
|
PARAM_NAME_USERIDS: inviteMember,
|
||||||
PARAM_NAME_GROUPID: widget.conversationType == ConvType.group ? widget.conversationID : ""
|
PARAM_NAME_GROUPID: widget.conversationType == ConvType.group
|
||||||
|
? widget.conversationID
|
||||||
|
: ""
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -685,7 +769,8 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
@override
|
@override
|
||||||
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
|
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
|
||||||
final TUITheme theme = value.theme;
|
final TUITheme theme = value.theme;
|
||||||
final TUIChatSeparateViewModel model = Provider.of<TUIChatSeparateViewModel>(context);
|
final TUIChatSeparateViewModel model =
|
||||||
|
Provider.of<TUIChatSeparateViewModel>(context);
|
||||||
final screenWidth = MediaQuery.of(context).size.width;
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
return Container(
|
return Container(
|
||||||
height: 248,
|
height: 248,
|
||||||
|
|
@ -722,12 +807,15 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
margin: const EdgeInsets.only(bottom: 4),
|
||||||
decoration: const BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(5))),
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.all(Radius.circular(5))),
|
||||||
child: item.icon,
|
child: item.icon,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
item.title,
|
item.title,
|
||||||
style: TextStyle(fontSize: 12, color: theme.darkTextColor),
|
style: TextStyle(
|
||||||
|
fontSize: 12, color: theme.darkTextColor),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,9 @@ fi
|
||||||
echo -e "${BLUE}Switching to master...${NC}"
|
echo -e "${BLUE}Switching to master...${NC}"
|
||||||
git checkout master
|
git checkout master
|
||||||
|
|
||||||
|
# 5.1 Save the current master commit BEFORE merge (Critical Fix)
|
||||||
|
MASTER_BEFORE_MERGE=$(git rev-parse HEAD)
|
||||||
|
|
||||||
# 6. Merge upstream-main into master
|
# 6. Merge upstream-main into master
|
||||||
echo -e "${BLUE}Merging upstream changes into master...${NC}"
|
echo -e "${BLUE}Merging upstream changes into master...${NC}"
|
||||||
# We use --no-commit to allow us to check/restore images before finalizing
|
# We use --no-commit to allow us to check/restore images before finalizing
|
||||||
|
|
@ -65,9 +68,9 @@ if git merge --no-commit upstream-main; then
|
||||||
else
|
else
|
||||||
echo -e "${RED}Merge conflict detected.${NC}"
|
echo -e "${RED}Merge conflict detected.${NC}"
|
||||||
echo "Attempting to auto-resolve protected paths conflicts by keeping OURS..."
|
echo "Attempting to auto-resolve protected paths conflicts by keeping OURS..."
|
||||||
# If conflict is in protected paths, we force checkout HEAD (ours) version
|
# If conflict is in protected paths, we force checkout master's version (before merge)
|
||||||
for path in $PROTECTED_PATHS; do
|
for path in $PROTECTED_PATHS; do
|
||||||
git checkout HEAD -- "$path" || true
|
git checkout "$MASTER_BEFORE_MERGE" -- "$path" || true
|
||||||
done
|
done
|
||||||
echo "Note: Manual resolution may still be required for non-protected files."
|
echo "Note: Manual resolution may still be required for non-protected files."
|
||||||
fi
|
fi
|
||||||
|
|
@ -76,7 +79,7 @@ fi
|
||||||
# Regardless of merge status, we ensure protected folders are exactly what we had before
|
# Regardless of merge status, we ensure protected folders are exactly what we had before
|
||||||
echo -e "${BLUE}Ensuring protected paths are preserved...${NC}"
|
echo -e "${BLUE}Ensuring protected paths are preserved...${NC}"
|
||||||
for path in $PROTECTED_PATHS; do
|
for path in $PROTECTED_PATHS; do
|
||||||
git checkout HEAD -- "$path"
|
git checkout "$MASTER_BEFORE_MERGE" -- "$path"
|
||||||
done
|
done
|
||||||
|
|
||||||
# 8. Check for conflicts
|
# 8. Check for conflicts
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue