|
@@ -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(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|