feat: 修改hidialog弹窗位置,增加macos dmg打包配置

This commit is contained in:
2026-01-12 00:45:52 -08:00
parent 2d1f391932
commit e6ee3d6db8
22 changed files with 393 additions and 157 deletions
@@ -46,6 +46,8 @@ class KRHomeView extends StatefulWidget implements HasSwipeConfig {
class _KRHomeViewState extends State<KRHomeView> {
late KRHomeController controller;
final GlobalKey _quickConnectTextKey = GlobalKey();
@override
void initState() {
super.initState();
@@ -198,12 +200,15 @@ class _KRHomeViewState extends State<KRHomeView> {
),
SizedBox(width: 8),
// 2. “闪连”标签
Text(
'闪连',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w600,
Container(
key: _quickConnectTextKey,
child: Text(
'闪连',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
),
],
@@ -214,10 +219,26 @@ class _KRHomeViewState extends State<KRHomeView> {
SizedBox(width: 6), // 文字和问号图标之间的间距
GestureDetector(
onTap: () {
Offset? targetOffset;
final renderBox = _quickConnectTextKey
.currentContext
?.findRenderObject() as RenderBox?;
if (renderBox != null) {
final position =
renderBox.localToGlobal(Offset.zero);
targetOffset = Offset(
position.dx - 26,
position.dy +
renderBox.size.height +
10.w,
);
}
HIDialog.show(
title: '闪连功能',
message:
'开启后,每次打开软件默认自动连接,无需点击连接按钮\n在后台关闭软件后,软件将自动断开',
targetOffset: targetOffset,
);
},
child: KrLocalImage(