Home > Blockchain >  Android - How to display a disclaimer before asking for permissions
Android - How to display a disclaimer before asking for permissions

Time:03-20

According with the Google policies for location, a disclaimer must be displayed before asking for permissions, but, with the Permissions handler package, the permissions are asked before the disclaimer dialog. How may I sort this?

CodePudding user response:

You can implement AlertDialog and trigger permission when the user clicks on Grant Button.

You can trigger this dialog in initstate

Code in Action

showDialog(
  context: context,
  builder: (context) => AlertDialog(
    title: const Text("Alert"),
    content: const Text("I need Permission......"),
    actions: [
      TextButton(
        child: const Text("Grant Permission"),
        onPressed: () async {
          Navigator.pop(context);
          // Reguest permission here
        }
      ),
    ],
  ),
);  
  • Related