RPConsentSection constructor

RPConsentSection({
  1. required RPConsentSectionType type,
  2. String? title,
  3. required String summary,
  4. String? content,
  5. List<RPDataTypeSection>? dataTypes,
  6. 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.

Implementation

RPConsentSection(
    {required this.type,
    String? title,
    required this.summary,
    this.content,
    this.dataTypes,
    this.customIllustration}) {
  assert(type != RPConsentSectionType.Custom || title != null,
      "If a you are creating a Custom ConsentSection, then a title must be provided.");
  this.title = (type == RPConsentSectionType.Custom)
      ? title!
      : (title != null)
          ? title
          : "title.${type.name.toLowerCase()}";
}