目前使用 flutter share_extend 2.0.0 和 Permission_handler 11.0.0 时遇到此问题 我正在尝试在我的应用程序中共享交易收据,它在 IOS 上运行良好,但在 Android 上则不然,我已添加了必要的权限,但它不起作用
查看了我的清单文件,仍然找不到问题所在
无效检查权限( {全局密钥?重画键,字符串?参考,BuildContext?上下文}) 异步 { 最终状态=等待Permission.storage.status;
if (status.isGranted || await Permission.storage.request().isGranted) {
print('who granted this ${status}');
takescrshot(
repaintKey: repaintKey!, reference: reference, context: context);
} else {
print('who denied this ${status}');
if (await Permission.storage.isDenied) {
if (await Permission.storage.request().isGranted) {
takescrshot(
repaintKey: repaintKey!, reference: reference, context: context);
}
} else if (await Permission.storage.isPermanentlyDenied) {
openAppSettings();
} else {
if (await Permission.storage.request().isGranted) {
takescrshot(
repaintKey: repaintKey!, reference: reference, context: context);
}
}
}
}
我刚刚通过将我的 flutter 版本从 3.13.0 升级到 3.16.7 解决了这个问题 它开始起作用了。