I try to code some gallery picker function from Youtube but I want to ask for permission for storage to user ,when I code below code, I get into the app info why I get there and how to fix it
import 'package:photo_manager/photo_manager.dart';
class MediaServices {
Future loadAlbum(RequestType requestType) async {
var permission = await PhotoManager.requestPermissionExtend();
List<AssetPathEntity> albumList = [];
if (permission == true) {
albumList = await PhotoManager.getAssetPathList(
type: requestType,
);
} else {
PhotoManager.openSetting();
}
return albumList;
}
Future loadAssets(AssetPathEntity selectedAlbum) async {
// ignore: deprecated_member_use
List<AssetEntity> assetList = await selectedAlbum.getAssetListRange(
// ignore: deprecated_member_use
start: 0, end: selectedAlbum.assetCount);
return assetList;
}
}