RPConsentSection
A content section in a RPConsentDocument.
It represents one section in a RPConsentDocument.
- Inheritance
-
- Object
- Serializable
- RPConsentSection
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
RPConsentSection.fromJson
RPConsentSection
- required RPConsentSectionType type,
- String? title,
- required String summary,
- String? content,
- List<
RPDataTypeSection> ? dataTypes, - List<
RPPermissionType> ? permissions, - List<
HealthDataType> ? healthDataTypes, - Widget? customIllustration,
Create a new RPConsentSection of a given type.
It is enough to provide the type and summary of the section. If a title is not provided, a default title is used, unless the type is RPConsentSectionType.Custom. In that case, the title must be provided.
Properties
content
A longer content text of the section.
It's presented during RPVisualConsentStep when tapping on the "Learn more" button and during RPConsentReviewStep where each section's content is shown to the user.
customIllustration
- @JsonKey(includeFromJson: false, includeToJson: false)
A custom illustration (an Image or Icon to show for Custom RPConsentSectionType
dataTypes
The data type sections that will be displayed if the consent section is of type UserDataCollection or PassiveDataCollection.
fromJsonFunction
The function which can convert a JSON string to an object of this type.
healthDataTypes
The health data types this section explains the need for.
Health data is not a single permission — Apple HealthKit and Android Health Connect authorise each data type separately — so listing RPPermissionType.health in permissions is not enough on its own. This is the list which is actually asked for, and it also documents in the consent document itself which health data the study reads.
Read access is requested for every type listed. Ignored unless permissions contains RPPermissionType.health; conversely, that permission resolves to RPPermissionStatus.unsupported if this is null or empty, since there would be nothing to ask for.
permissions
The OS permissions which this section explains the need for.
They are requested when the participant taps "NEXT" on this section during a RPVisualConsentStep which has RPVisualConsentStep.askPermission set to true. This way the permission dialog is shown in context, with the summary and content of this section as the rationale — which is what both Apple and Google ask for.
If null or empty, no permissions are requested for this section.
summary
A short summary of the section. It appears during RPVisualConsentStep
title
The title of the consent section which appears both in RPVisualConsentStep and RPConsentReviewStep.
type
The type of the section.
The title and the image which is shown on the section card is associated to the type.
Methods
toJson
Return a JSON encoding of this object.