Models: preferences
Topics, channels and choices, from package:crm_sdk/wire.dart.
import 'package:crm_sdk/wire.dart';| Name | What it is |
|---|---|
CrmExportConsentChange | One change of the guest’s choices, in their export: a topic’s, or a channel’s own switch (topic empty). |
CrmExportSubscription | One of the guest’s choices about a topic by a channel, in their export. |
CrmPreferenceChoice | One choice: a topic, a channel, in or out. |
CrmPreferenceState | One channel of a topic, and whether the guest is subscribed by it. |
CrmPreferenceTopic | One of the app’s topics, as the guest sees it. |
CrmPreferences | The guest’s preferences: every topic of the app’s not archived, and whether all their marketing is off. |
CrmPreferencesBody | The guest’s choices, kept as a change only where each differs from what they had; or allOff, “Unsubscribe from all marketing”. wording is the version of the words they agreed under. |
CrmPublicPreferences | What PurrCRM’s public preference centre shows: the app’s brand, the address with most of it hidden, and the guest’s preferences. |
crmMaxPreferenceChoices | The most choices one body makes. |
crmMaxPreferenceWording | The longest wording version a body names. |
crmPreferencesWording | The wording version the package’s own preferences screen sends, so that what a guest agreed under is on record (the screen’s words are the package’s l10n strings, versioned with it). |
CrmExportConsentChange
Section titled “CrmExportConsentChange”class CrmExportConsentChangeOne change of the guest’s choices, in their export: a topic’s, or a
channel’s own switch (topic empty).
Members of CrmExportConsentChange
Section titled “Members of CrmExportConsentChange”CrmExportConsentChange.fromJson()
Section titled “CrmExportConsentChange.fromJson()”factory CrmExportConsentChange.fromJson(Map<String, Object?> json)CrmExportConsentChange()
Section titled “CrmExportConsentChange()”const CrmExportConsentChange({required DateTime at, required CrmPreferenceChannel channel, required bool subscribed, required String source, String topic = '', String wording = ''})final DateTime atchannel
Section titled “channel”final CrmPreferenceChannel channelsource
Section titled “source”final String sourcesubscribed
Section titled “subscribed”final bool subscribedfinal String topicwording
Section titled “wording”final String wordingCrmExportSubscription
Section titled “CrmExportSubscription”class CrmExportSubscriptionOne of the guest’s choices about a topic by a channel, in their export.
Members of CrmExportSubscription
Section titled “Members of CrmExportSubscription”CrmExportSubscription.fromJson()
Section titled “CrmExportSubscription.fromJson()”factory CrmExportSubscription.fromJson(Map<String, Object?> json)CrmExportSubscription()
Section titled “CrmExportSubscription()”const CrmExportSubscription({required String topic, required CrmPreferenceChannel channel, required bool subscribed, required DateTime changedAt, required String source, String wording = ''})changedAt
Section titled “changedAt”final DateTime changedAtchannel
Section titled “channel”final CrmPreferenceChannel channelsource
Section titled “source”final String sourceHow it was made, in PurrCRM’s word: page, email, staff, import, api, sdk or migration.
subscribed
Section titled “subscribed”final bool subscribedfinal String topicThe topic’s name.
wording
Section titled “wording”final String wordingCrmPreferenceChoice
Section titled “CrmPreferenceChoice”class CrmPreferenceChoiceOne choice: a topic, a channel, in or out.
Members of CrmPreferenceChoice
Section titled “Members of CrmPreferenceChoice”CrmPreferenceChoice.fromJson()
Section titled “CrmPreferenceChoice.fromJson()”factory CrmPreferenceChoice.fromJson(Map<String, Object?> json)CrmPreferenceChoice()
Section titled “CrmPreferenceChoice()”const CrmPreferenceChoice({required String topicId, required CrmPreferenceChannel channel, required bool subscribed})channel
Section titled “channel”final CrmPreferenceChannel channelsubscribed
Section titled “subscribed”final bool subscribedtopicId
Section titled “topicId”final String topicIdtoJson
Section titled “toJson”Map<String, Object?> toJson()CrmPreferenceState
Section titled “CrmPreferenceState”class CrmPreferenceStateOne channel of a topic, and whether the guest is subscribed by it.
Members of CrmPreferenceState
Section titled “Members of CrmPreferenceState”CrmPreferenceState.fromJson()
Section titled “CrmPreferenceState.fromJson()”factory CrmPreferenceState.fromJson(Map<String, Object?> json)CrmPreferenceState()
Section titled “CrmPreferenceState()”const CrmPreferenceState({required CrmPreferenceChannel channel, required bool subscribed})channel
Section titled “channel”final CrmPreferenceChannel channelsubscribed
Section titled “subscribed”final bool subscribedCrmPreferenceTopic
Section titled “CrmPreferenceTopic”class CrmPreferenceTopicOne of the app’s topics, as the guest sees it.
Members of CrmPreferenceTopic
Section titled “Members of CrmPreferenceTopic”CrmPreferenceTopic.fromJson()
Section titled “CrmPreferenceTopic.fromJson()”factory CrmPreferenceTopic.fromJson(Map<String, Object?> json)CrmPreferenceTopic()
Section titled “CrmPreferenceTopic()”const CrmPreferenceTopic({required String id, required String name, String description = '', List<CrmPreferenceState> channels = const <CrmPreferenceState>[]})channels
Section titled “channels”final List<CrmPreferenceState> channelsThe channels it goes by, in PurrCRM’s order, a channel this package does not know yet left for the screen to skip.
description
Section titled “description”final String descriptionfinal String idfinal String nameCrmPreferences
Section titled “CrmPreferences”class CrmPreferencesThe guest’s preferences: every topic of the app’s not archived, and whether all their marketing is off.
Members of CrmPreferences
Section titled “Members of CrmPreferences”CrmPreferences.fromJson()
Section titled “CrmPreferences.fromJson()”factory CrmPreferences.fromJson(Map<String, Object?> json)CrmPreferences()
Section titled “CrmPreferences()”const CrmPreferences({List<CrmPreferenceTopic> topics = const <CrmPreferenceTopic>[], bool allOff = false})allOff
Section titled “allOff”final bool allOffEvery channel’s own switch is off: no topic reaches them until they choose one again.
topics
Section titled “topics”final List<CrmPreferenceTopic> topicsCrmPreferencesBody
Section titled “CrmPreferencesBody”class CrmPreferencesBodyThe guest’s choices, kept as a change only where each differs from
what they had; or allOff, “Unsubscribe from all marketing”. wording
is the version of the words they agreed under.
Members of CrmPreferencesBody
Section titled “Members of CrmPreferencesBody”CrmPreferencesBody.fromJson()
Section titled “CrmPreferencesBody.fromJson()”factory CrmPreferencesBody.fromJson(Map<String, Object?> json)CrmPreferencesBody()
Section titled “CrmPreferencesBody()”const CrmPreferencesBody({List<CrmPreferenceChoice> choices = const <CrmPreferenceChoice>[], bool allOff = false, String wording = ''})allOff
Section titled “allOff”final bool allOffchoices
Section titled “choices”final List<CrmPreferenceChoice> choiceswording
Section titled “wording”final String wordingtoJson
Section titled “toJson”Map<String, Object?> toJson()CrmPublicPreferences
Section titled “CrmPublicPreferences”class CrmPublicPreferencesWhat PurrCRM’s public preference centre shows: the app’s brand, the address with most of it hidden, and the guest’s preferences. The package never asks for it (the page is PurrCRM’s site’s); it is here so that every fixture has a model.
Members of CrmPublicPreferences
Section titled “Members of CrmPublicPreferences”CrmPublicPreferences.fromJson()
Section titled “CrmPublicPreferences.fromJson()”factory CrmPublicPreferences.fromJson(Map<String, Object?> json)CrmPublicPreferences()
Section titled “CrmPublicPreferences()”const CrmPublicPreferences({required String product, String accent = '', String logoUrl = '', String email = '', CrmPreferences preferences = const CrmPreferences()})accent
Section titled “accent”final String accentfinal String emaillogoUrl
Section titled “logoUrl”final String logoUrlpreferences
Section titled “preferences”final CrmPreferences preferencesproduct
Section titled “product”final String productcrmMaxPreferenceChoices
Section titled “crmMaxPreferenceChoices”const int crmMaxPreferenceChoicesThe most choices one body makes. The Go constant is MaxPreferenceChoices.
crmMaxPreferenceWording
Section titled “crmMaxPreferenceWording”const int crmMaxPreferenceWordingThe longest wording version a body names. The Go constant is MaxPreferenceWording.
crmPreferencesWording
Section titled “crmPreferencesWording”const String crmPreferencesWordingThe wording version the package’s own preferences screen sends, so that what a guest agreed under is on record (the screen’s words are the package’s l10n strings, versioned with it).
Protocol data: PurrCRM keeps it beside every consent given through the
screen, so it stays byte for byte while the screen’s words stay as they
are. Only a change to those words takes a new id
(crm_sdk/preferences-2, say), with a CHANGELOG entry.