Open specific app's permission setting flutter?

Viewed 6860

I wonder how to open permission setting for specific app in Flutter? I search on internet but no article show me how to do that, just some solutions for android, like this. Open app permission settings

2 Answers

hi there try this code to ask for permission and open app settings like for location with the help of permission_handler(https://pub.dev/packages/permission_handler) package

Future<void> _request_permission(context,Function fn)async{
    final Permission location_permission=Permission.location;
    bool location_status=false;
    bool ispermanetelydenied= await location_permission.isPermanentlyDenied;
    if(ispermanetelydenied) {
      print("denied");
      await  openAppSettings();
    }else{
      var location_statu = await location_permission.request();
      location_status=location_statu.isGranted;
      print(location_status);
    }
 
  }

Here this function allows you to open the app setting and manage permission in the case user permanently denied the permission

openAppSettings();

thanks

@azad-prajapat And when I look at the package code I found this

/// Opens the app settings page.
  ///
  /// Returns [true] if the app settings page could be opened, otherwise
  /// [false].
  Future<bool> openAppSettings() {
    throw UnimplementedError('openAppSettings() has not been implemented.');
  }
Related