Skip to content

RPVisualConsentStep

The step used for presenting the consent document to the participant

To use a visual consent step, first create a consent document (RPConsentDocument) with at least one section and attach the document to a visual consent step. Put the visual consent step into a Research Package task, and present it with an RPUITask.

Inheritance
Annotations

Constructors

RPVisualConsentStep.fromJson

RPVisualConsentStep.fromJson(
  1. Map<String, dynamic> json
)

RPVisualConsentStep

RPVisualConsentStep({
  1. required String identifier,
  2. required RPConsentDocument consentDocument,
  3. bool askPermission = false,
})

Properties

askPermission

bool askPermission
getter/setter pair

Should the OS permissions declared on the sections of the consentDocument be requested while going through them?

When true, tapping "NEXT" on a section which has RPConsentSection.permissions triggers the native permission dialog for each of them before moving on, so the participant is asked in context. The outcome of every request is collected in an RPPermissionResult which is added to the task result under this step's identifier. A denied permission is recorded but never blocks the participant.

false by default, in which case no permission is ever requested and no RPPermissionResult is produced.

Note that the host app is responsible for declaring the permissions it asks for in Info.plist (iOS) and AndroidManifest.xml (Android), and that RPPermissionType.health additionally needs a RPPermissions.healthHandler.

consentDocument

RPConsentDocument consentDocument
getter/setter pair

The consent document whose sections determine the order and appearance of scenes in the visual consent step.

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

stepWidget

  1. @override
  2. @JsonKey(includeFromJson: false, includeToJson: false)
Widget get stepWidget
override

The widget (UI representation) of the step

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.