Browse Source

1.优化权限获取显示

tags/0.0.13+4
“yanghuaxuan” 3 years ago
parent
commit
041a888952
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      lib/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart

+ 7
- 6
lib/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart View File

@@ -33,17 +33,18 @@ class NotificationSettingDialog extends StatelessWidget {
await Permission.notification.request(); await Permission.notification.request();
if (await Permission.notification.isDenied) { if (await Permission.notification.isDenied) {
var packageInfo = await PackageInfo.fromPlatform(); var packageInfo = await PackageInfo.fromPlatform();
await showDialog(
var result = await showDialog(
context: context, context: context,
child: TipDialog( child: TipDialog(
btnText: "去打开", btnText: "去打开",
content: "系统检查到您还未开启通知权限,可通过以下指引打开通知权限\n 设置 -> 应用管理 -> " + (packageInfo?.appName ?? "") + " -> 通知管理", content: "系统检查到您还未开启通知权限,可通过以下指引打开通知权限\n 设置 -> 应用管理 -> " + (packageInfo?.appName ?? "") + " -> 通知管理",
)); ));

if (Platform.isAndroid) {
NativeUtil.openAppSettings();
} else {
openAppSettings();
if (result != null && result) {
if (Platform.isAndroid) {
NativeUtil.openAppSettings();
} else {
openAppSettings();
}
} }
} }
} }


Loading…
Cancel
Save