feat: 修复ios上未检测到账号,弹窗没显示问题
This commit is contained in:
parent
24cf03d6ce
commit
56c7fd6921
@ -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/global_overlay_service.dart';
|
||||||
import 'package:kaer_with_panels/app/services/singbox_imp/kr_sing_box_imp.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/singbox/model/singbox_status.dart';
|
||||||
|
import 'package:kaer_with_panels/app/utils/account_guard.dart';
|
||||||
|
|
||||||
DateTime? _hiConnectBtnNextAllowedAt;
|
DateTime? _hiConnectBtnNextAllowedAt;
|
||||||
const Duration _hiConnectBtnDebounce = Duration(milliseconds: 800);
|
const Duration _hiConnectBtnDebounce = Duration(milliseconds: 800);
|
||||||
@ -90,8 +91,10 @@ class HIAnimatedConnectButton extends GetView<KRHomeController> {
|
|||||||
: Theme.of(context).primaryColor,
|
: Theme.of(context).primaryColor,
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
HapticFeedback.lightImpact();
|
HapticFeedback.lightImpact();
|
||||||
|
final ok = await ensureAccountExists();
|
||||||
|
if (!ok) return;
|
||||||
final _now = DateTime.now();
|
final _now = DateTime.now();
|
||||||
if (_hiConnectBtnNextAllowedAt != null &&
|
if (_hiConnectBtnNextAllowedAt != null &&
|
||||||
_now.isBefore(_hiConnectBtnNextAllowedAt!)) {
|
_now.isBefore(_hiConnectBtnNextAllowedAt!)) {
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
import '../controllers/kr_home_controller.dart';
|
import '../controllers/kr_home_controller.dart';
|
||||||
import '../../../routes/app_pages.dart';
|
import '../../../routes/app_pages.dart';
|
||||||
import 'package:kaer_with_panels/app/services/global_overlay_service.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 (保持不变) =======================
|
// ======================= 1. Circular Clipper (保持不变) =======================
|
||||||
class CircularClipper extends CustomClipper<Path> {
|
class CircularClipper extends CustomClipper<Path> {
|
||||||
@ -173,7 +174,11 @@ class _HISubscriptionCornerButtonState extends State<HISubscriptionCornerButton>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _startCircularTransition(context),
|
onTap: () async {
|
||||||
|
final ok = await ensureAccountExists();
|
||||||
|
if (!ok) return;
|
||||||
|
_startCircularTransition(context);
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
key: _buttonKey, // 绑定 GlobalKey
|
key: _buttonKey, // 绑定 GlobalKey
|
||||||
width: widget.size,
|
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/has_swipe_config.dart';
|
||||||
import 'package:kaer_with_panels/app/widgets/swipe/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/routes/app_pages.dart';
|
||||||
|
import 'package:kaer_with_panels/app/utils/account_guard.dart';
|
||||||
|
|
||||||
class KRHomeView extends StatefulWidget implements HasSwipeConfig {
|
class KRHomeView extends StatefulWidget implements HasSwipeConfig {
|
||||||
const KRHomeView({super.key});
|
const KRHomeView({super.key});
|
||||||
@ -29,10 +30,17 @@ class KRHomeView extends StatefulWidget implements HasSwipeConfig {
|
|||||||
enableLeft: true,
|
enableLeft: true,
|
||||||
enableRight: true,
|
enableRight: true,
|
||||||
onLeft: () {
|
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
|
@override
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:kaer_with_panels/app/widgets/kr_local_image.dart';
|
import 'package:kaer_with_panels/app/widgets/kr_local_image.dart';
|
||||||
import 'package:kaer_with_panels/app/routes/app_pages.dart';
|
import 'package:kaer_with_panels/app/routes/app_pages.dart';
|
||||||
|
import 'package:kaer_with_panels/app/utils/account_guard.dart';
|
||||||
|
|
||||||
/// 🔹 HIBaseScaffold
|
/// 🔹 HIBaseScaffold
|
||||||
/// 用于统一页面结构:
|
/// 用于统一页面结构:
|
||||||
@ -112,7 +113,9 @@ class HIBaseScaffold extends StatelessWidget {
|
|||||||
// 优先显示菜单按钮
|
// 优先显示菜单按钮
|
||||||
if (showMenuButton) {
|
if (showMenuButton) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
|
final ok = await ensureAccountExists();
|
||||||
|
if (!ok) return;
|
||||||
Get.toNamed(Routes.HI_MENU);
|
Get.toNamed(Routes.HI_MENU);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|||||||
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 0.0.4+101
|
version: 0.0.4+103
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.5.0 <4.0.0'
|
sdk: '>=3.5.0 <4.0.0'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user