13

Something similar to How to programmatically open the Permission Screen for a specific app on Android Marshmallow? but for flutter dart.

Anonk
  • 1,473
  • 4
  • 13
  • 15

4 Answers4

10

You can use the permission_handler package

Open app settings

import 'package:permission_handler/permission_handler.dart';

bool isOpened = await PermissionHandler().openAppSettings();
iDecode
  • 22,623
  • 19
  • 99
  • 186
theboringdeveloper
  • 1,429
  • 13
  • 17
  • https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_platform_interface/lib/src/permission_handler_platform_interface.dart I check the source code of that package and found this. Future openAppSettings() { throw UnimplementedError('openAppSettings() has not been implemented.'); } – SULPHURIC ACID Dec 28 '21 at 12:49
7

You can use openAppSettings() method.

 var status = await Permission.camera.status;
 if (status.isPermanentlyDenied) {
              await openAppSettings();
            }
Cavid Aydın
  • 129
  • 1
  • 7
5

Use android_intent plugin and put this code:

AndroidIntent intent = AndroidIntent(
  action: "android.settings.APPLICATION_DETAILS_SETTINGS",
  package: "your_app_package_name",
  data: "package:your_app_package_name",
);
intent.launch();
CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
0

You can use platform plugins to call native APIs. In this case, you should use the Android intent plugin.

Collin Jackson
  • 110,240
  • 31
  • 221
  • 152