feat: 修复ios上未检测到账号,弹窗没显示问题
This commit is contained in:
@@ -11,6 +11,7 @@ import 'package:kaer_with_panels/app/widgets/kr_app_text_style.dart';
|
||||
import 'package:kaer_with_panels/app/services/global_overlay_service.dart';
|
||||
import 'package:kaer_with_panels/app/services/singbox_imp/kr_sing_box_imp.dart';
|
||||
import 'package:kaer_with_panels/singbox/model/singbox_status.dart';
|
||||
import 'package:kaer_with_panels/app/utils/account_guard.dart';
|
||||
|
||||
DateTime? _hiConnectBtnNextAllowedAt;
|
||||
const Duration _hiConnectBtnDebounce = Duration(milliseconds: 800);
|
||||
@@ -90,8 +91,10 @@ class HIAnimatedConnectButton extends GetView<KRHomeController> {
|
||||
: Theme.of(context).primaryColor,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
HapticFeedback.lightImpact();
|
||||
final ok = await ensureAccountExists();
|
||||
if (!ok) return;
|
||||
final _now = DateTime.now();
|
||||
if (_hiConnectBtnNextAllowedAt != null &&
|
||||
_now.isBefore(_hiConnectBtnNextAllowedAt!)) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import '../controllers/kr_home_controller.dart';
|
||||
import '../../../routes/app_pages.dart';
|
||||
import 'package:kaer_with_panels/app/services/global_overlay_service.dart';
|
||||
import 'package:kaer_with_panels/app/utils/account_guard.dart';
|
||||
|
||||
// ======================= 1. Circular Clipper (保持不变) =======================
|
||||
class CircularClipper extends CustomClipper<Path> {
|
||||
@@ -173,7 +174,11 @@ class _HISubscriptionCornerButtonState extends State<HISubscriptionCornerButton>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => _startCircularTransition(context),
|
||||
onTap: () async {
|
||||
final ok = await ensureAccountExists();
|
||||
if (!ok) return;
|
||||
_startCircularTransition(context);
|
||||
},
|
||||
child: Container(
|
||||
key: _buttonKey, // 绑定 GlobalKey
|
||||
width: widget.size,
|
||||
@@ -185,4 +190,4 @@ class _HISubscriptionCornerButtonState extends State<HISubscriptionCornerButton>
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import 'package:kaer_with_panels/app/services/global_overlay_service.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/swipe/has_swipe_config.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/swipe/swipe_config.dart';
|
||||
import 'package:kaer_with_panels/app/routes/app_pages.dart';
|
||||
import 'package:kaer_with_panels/app/utils/account_guard.dart';
|
||||
|
||||
class KRHomeView extends StatefulWidget implements HasSwipeConfig {
|
||||
const KRHomeView({super.key});
|
||||
@@ -29,10 +30,17 @@ class KRHomeView extends StatefulWidget implements HasSwipeConfig {
|
||||
enableLeft: true,
|
||||
enableRight: true,
|
||||
onLeft: () {
|
||||
Get.toNamed(Routes.HI_MENU);
|
||||
ensureAccountExists().then((ok) {
|
||||
if (!ok) return;
|
||||
Get.toNamed(Routes.HI_MENU);
|
||||
});
|
||||
},
|
||||
onRight: () {
|
||||
ensureAccountExists().then((ok) {
|
||||
if (!ok) return;
|
||||
GlobalOverlayService.instance.triggerSubscriptionAnimation();
|
||||
});
|
||||
},
|
||||
onRight: () =>
|
||||
GlobalOverlayService.instance.triggerSubscriptionAnimation(),
|
||||
);
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user