From bb1cab3b00b9d540c81242a6af0b280865a4d256 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Tue, 7 Jan 2025 20:03:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20umeng=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E5=90=88=E8=A7=84=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tools/appFirstEnterHandle.dart | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/tools/appFirstEnterHandle.dart b/lib/tools/appFirstEnterHandle.dart index a465063b..129a3cdc 100755 --- a/lib/tools/appFirstEnterHandle.dart +++ b/lib/tools/appFirstEnterHandle.dart @@ -23,9 +23,12 @@ class AppFirstEnterHandle { switch (flagStr) { case isAgreePrivacy: // 隐私协议 if (getFlag != isAgreePrivacy) { - await showPrivacyAgreementAlert(); + final bool? isAgree = await showPrivacyAgreementAlert(); + if (isAgree ?? false) { + await privacySDKInitialization(); + } } - await privacySDKInitialization(); + if (Get.isRegistered()) { Get.find().flushedDeviceInfo(); } @@ -51,8 +54,8 @@ class AppFirstEnterHandle { } //隐私协议弹窗 - Future showPrivacyAgreementAlert() async { - await showCupertinoDialog( + Future showPrivacyAgreementAlert() async { + return await showCupertinoDialog( context: Get.context!, builder: (BuildContext context) { return PopScope( @@ -124,7 +127,7 @@ class AppFirstEnterHandle { ), onPressed: () { Storage.setString(isAgreePrivacy, isAgreePrivacy); - Navigator.of(context).pop(); + Navigator.of(context).pop(true); getAppFirstEnter(isShowUpdateVersion); }, ), @@ -195,7 +198,7 @@ class AppFirstEnterHandle { ), onPressed: () { Storage.setString(isAgreePrivacy, isAgreePrivacy); - Navigator.of(context).pop(); + Navigator.of(context).pop(true); getAppFirstEnter(isShowUpdateVersion); }, ),