diff --git a/lib/tools/appFirstEnterHandle.dart b/lib/tools/appFirstEnterHandle.dart index f18faea1..1d8d58cc 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( @@ -123,7 +126,7 @@ class AppFirstEnterHandle { ), onPressed: () { Storage.setString(isAgreePrivacy, isAgreePrivacy); - Navigator.of(context).pop(); + Navigator.of(context).pop(true); getAppFirstEnter(isShowUpdateVersion); }, ), @@ -193,7 +196,7 @@ class AppFirstEnterHandle { ), onPressed: () { Storage.setString(isAgreePrivacy, isAgreePrivacy); - Navigator.of(context).pop(); + Navigator.of(context).pop(true); getAppFirstEnter(isShowUpdateVersion); }, ),