requestLocationPermission method

Future<void> requestLocationPermission(
  1. dynamic onPermissionGranted()
)

Implementation

Future<void> requestLocationPermission(Function() onPermissionGranted) async {
  final status = await Permission.location.request();
  if (status.isGranted) {
    onPermissionGranted();
  } else {
    print('Location permission denied');
  }
}