requestHealthKitPermissions method
Requests HealthKit permissions for the specified health data types.
This method prompts the user to grant permissions for accessing the specified health data types. The user will see a system dialog where they can choose which data types to allow or deny.
Parameters:
dataTypes: List of health data types to request permissions for.
Returns true if the permission request was successfully initiated,
false otherwise. Note that this doesn't indicate whether permissions
were granted - use checkHealthKitPermissionStatus to verify the actual
permission status after requesting.
Implementation
Future<bool> requestHealthKitPermissions({
required List<HealthDataType> dataTypes,
}) {
return StepsCountPlatform.instance.requestHealthKitPermissions(
dataTypes: dataTypes,
);
}