Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ private fun TCF2Settings.serialize(): Any {
"changedPurposes" to changedPurposes?.serialize(),
"acmV2Enabled" to acmV2Enabled,
"selectedATPIds" to selectedATPIds,
"consentOrPay" to consentOrPay?.serialize()
"consentOrPay" to consentOrPay?.serialize(),
"mandatoryLabel" to mandatoryLabel
)
}

Expand Down
3 changes: 2 additions & 1 deletion ios/Classes/Serializer/CMPDataSerializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ extension TCF2Settings {
"changedPurposes": self.changedPurposes?.serialize() as Any,
"acmV2Enabled" : self.acmV2Enabled,
"selectedATPIds" : self.selectedATPIds,
"consentOrPay": self.consentOrPay?.serialize() as Any
"consentOrPay": self.consentOrPay?.serialize() as Any,
"mandatoryLabel": self.mandatoryLabel
]
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/src/internal/serializer/tcf2_settings_serializer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class TCF2SettingsSerializer {
acmV2Enabled: value['acmV2Enabled'] ?? false,
selectedATPIds: value['selectedATPIds']?.cast<int>() ?? [],
consentOrPay: TCF2ConsentOrPaySettingsSerializer.deserialize(
value['consentOrPay']));
value['consentOrPay']),
mandatoryLabel: value['mandatoryLabel'] ?? "Mandatory");
}
}

Expand Down
10 changes: 7 additions & 3 deletions lib/src/model/tcf2_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class TCF2Settings {
required this.changedPurposes,
required this.acmV2Enabled,
required this.selectedATPIds,
this.consentOrPay});
this.consentOrPay,
this.mandatoryLabel = "Mandatory"});

final String firstLayerTitle;
final String secondLayerTitle;
Expand Down Expand Up @@ -123,6 +124,7 @@ class TCF2Settings {
final bool acmV2Enabled;
final List<int> selectedATPIds;
final TCF2ConsentOrPaySettings? consentOrPay;
final String mandatoryLabel;

@override
bool operator ==(Object other) =>
Expand Down Expand Up @@ -192,7 +194,8 @@ class TCF2Settings {
changedPurposes == other.changedPurposes &&
acmV2Enabled == other.acmV2Enabled &&
listEquals(selectedATPIds, other.selectedATPIds) &&
consentOrPay == other.consentOrPay;
consentOrPay == other.consentOrPay &&
mandatoryLabel == other.mandatoryLabel;

@override
int get hashCode =>
Expand Down Expand Up @@ -255,7 +258,8 @@ class TCF2Settings {
changedPurposes.hashCode +
acmV2Enabled.hashCode +
selectedATPIds.hashCode +
consentOrPay.hashCode;
consentOrPay.hashCode +
mandatoryLabel.hashCode;

@override
String toString() => "$TCF2Settings($hashCode)";
Expand Down
Loading