I’m making the use of read and write permission for accessing external storage and for getting the permission, I’m using the permission handler package
AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
For getting the permission from user
var status = await Permission.storage.request();
if(status.isGranted){
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => const Home()));
} else if(status.isPermanentlyDenied){
openAppSettings();
}
The above permissions and code working perfectly for android versions till 12 but when it comes to android version 13, it is not working up, it just opens up the app setting instead of asking the permission
2
Answers
For Android 13 or higher
Menifest Permissions
permission_handler (request)
setp 1
add permission android manifest
setp 2
enter image description here