Search code examples
androidflutterandroid-permissionsflutter-android

Flutter : Ask the user for permission until permission is granted


Using https://pub.dev/packages/permission_handler to get permissions

but it won't ask the user again if user denied permission.

currently checked it on android (iOS device is not available)

Pls Help


Solution

  • If a user has already denied, only thing could be done is to redirect the user to application settings to enable needed permissions.

    if (await Permission.speech.isPermanentlyDenied) {
      // The user opted to never again see the permission request dialog for this
      // app. The only way to change the permission's status now is to let the
      // user manually enable it in the system settings.
      openAppSettings();
    }