|
|
@@ -279,6 +279,17 @@ class _GoodsShareImageState extends State<GoodsShareImage> |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查并请求权限 |
|
|
|
status = await Permission.storage.status; |
|
|
|
if (status != PermissionStatus.granted) { |
|
|
|
status = await Permission.storage.request(); |
|
|
|
} |
|
|
|
if (status == PermissionStatus.denied) { |
|
|
|
Fluttertoast.showToast(msg: '暂无权限,分享失败'); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool isSaveSuccess = false; |
|
|
|
if (_shareModel.poster != null) { |
|
|
|
isSaveSuccess = await SaveImage.save(imageBytes: _shareModel.poster); |
|
|
|