hasPermission method
Implementation
Future<bool> hasPermission(List<HealthPermission> healthPermissions) async {
final types =
healthPermissions.map<HealthDataType>((e) => e.healthDataType).toList();
final permissions = healthPermissions
.map<HealthDataAccess>((e) => e.healthDataAccess)
.toList();
final hasPermission =
await health.hasPermissions(types, permissions: permissions);
return hasPermission ?? true;
}