Opening Location Permission from the inside of App flutter
Asked Answered
C

3

8

the page i want to access from inside the app : enter image description here

Campobello answered 25/1, 2021 at 11:49 Comment(4)
Try this plugin.Chandigarh
Use permission_handler for this, pub.dev/packages/permission_handlerLaugh
i am already using this package but it doesn't take me to this page specifecally, it opens app setting in general. @ChandigarhCampobello
@DharaPatel permission_handler package doesn't do the required job tooCampobello
M
18

Using Geolocator Package, you can open location settings as per below. You may note that this operation can only open the device Location Permission page, not the entire App permission manager.

Geolocator.openLocationSettings();
Milano answered 25/1, 2021 at 12:12 Comment(3)
i need to open the app permission manager on the location tab specifcallyCampobello
Unless you build your own channel to open a specific Android IntentMilano
Geolocator also has an openAppSettings() method.Pledge
M
5

Use this package called, permission_handler. This will allow you to open the app settings page where you can find the location permission.

usage:

RaisedButton(
            onPressed: () =>  openAppSettings(),
            child: Text("Open app settings"),
          ),
Month answered 25/1, 2021 at 12:23 Comment(1)
works like a charm! everyone working with permissions should already have permission_handler anywayThirdrate
R
2

In GeoLocation Package use Geolocator.openAppSettings();

Like that

AlertDialog(
            actions: [
              CupertinoDialogAction(
                child: Text('Back'),
                onPressed: () {
                  if (Platform.isIOS) {
                    exit(0);
                  } else {
                    SystemNavigator.pop();
                  }
                },
              ),
              CupertinoDialogAction(
                child: Text('Settings'),
                onPressed: () {
                  Geolocator.openAppSettings();
                },
              ),
            ],
          ),
Redwing answered 14/3, 2022 at 7:50 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.