RPConsentSection constructor
RPConsentSection({
- required RPConsentSectionType type,
- String? title,
- required String summary,
- String? content,
- List<
RPDataTypeSection> ? dataTypes, - 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()}";
}