Models: in-app messages and surveys
In-app messages, carousels and surveys, from package:crm_sdk/wire.dart.
import 'package:crm_sdk/wire.dart';| Name | What it is |
|---|---|
AppLinksReport | The destinations a build declares, sent when a check-in asks (PUT /guest/v1/app-links): PurrCRM offers them to staff to add to the app’s catalogue. |
Carousel | Screens the guest moves through, which may branch: each button and each answer of a choice says where it goes (a screen, or the end), and a screen’s CarouselScreen.next says where Next and a forward swipe go. |
CarouselBackground | What is behind a screen. |
CarouselButton | One of a screen’s buttons. |
CarouselChoice | A question on a screen, answered by tapping its options. |
CarouselImage | A screen’s hero picture. |
CarouselOption | One answer of a choice. |
CarouselScreen | One screen of a carousel. |
CarouselStyle | A carousel’s look, or a screen’s over it. |
Checkin | What a check-in answers: the messages to show now, in order. |
CheckinBody | What the app says when it checks in. |
DeclaredLink | One place in the host a link may go, as the host declares it (CrmHost.links): its name for staff, its path template (/offers/{offer_id}), and optionally its page on the web and its screen’s name. |
ExportReceipt | A message the guest was sent or shown, in their export. |
ExportSurveyAnswer | One answer, as the question’s words and the answer’s. |
ExportSurveyResponse | The guest’s answers to one survey, in their export. |
ExportTestPhone | The guest’s account being a test phone, in their export: staff’s name for it, and since when. |
ExportTestSend | One test staff sent to the guest’s test phone, in their export: what it was, and what became of it. |
InAppBanner | A strip across the screen. |
InAppMessage | One in-app message: exactly one of its contents, by kind. |
InAppPost | A full-screen message, from a teammate or from the product. |
OpenMessageBody | The message a link opened: the session it is shown in. |
ReceiptBody | What the guest did with a message. |
Survey | A survey: steps of questions, one after another, a branch skipping ahead on an answer, ending at a thank-you step or the last. |
SurveyAnswer | One answer: a number, options, or words, by the question’s type. |
SurveyAnswerBody | A survey’s answers so far. |
SurveyBranch | A step’s way forward on an answer: a number in [min, max], or a choice among values, goes to next. |
SurveyOption | One option of a choice question. |
SurveyQuestion | One question. |
SurveyStep | One step of a survey. |
SurveySubmit | A survey finished: every answer on the path the guest took. |
carouselEnd | The target that ends a carousel. |
checkinEvery | The least time between two check-ins; a sooner one is answered throttled. |
maxCarouselScreens | The most screens a carousel has. |
maxLongAnswerRunes | The longest long answer. |
maxOtherRunes | The longest words for “Other”. |
maxReceiptPath | The most screens a receipt’s path names. |
maxShortAnswerRunes | The longest short answer. |
otherOption | The option id of “Other” on a choice question that allows it. |
AppLinksReport
Section titled “AppLinksReport”class AppLinksReportThe destinations a build declares, sent when a check-in asks (PUT /guest/v1/app-links): PurrCRM offers them to staff to add to the app’s catalogue.
Members of AppLinksReport
Section titled “Members of AppLinksReport”AppLinksReport.fromJson()
Section titled “AppLinksReport.fromJson()”factory AppLinksReport.fromJson(Map<String, Object?> json)AppLinksReport()
Section titled “AppLinksReport()”const AppLinksReport({required String appVersion, required String digest, required List<DeclaredLink> links})appVersion
Section titled “appVersion”final String appVersiondigest
Section titled “digest”final String digestlinksDigest of links.
final List<DeclaredLink> linkstoJson
Section titled “toJson”Map<String, Object?> toJson()Carousel
Section titled “Carousel”class CarouselScreens the guest moves through, which may branch: each button and
each answer of a choice says where it goes (a screen, or the end), and a
screen’s CarouselScreen.next says where Next and a forward swipe go. Screens may loop back; every screen the guest can reach has a way to the
end (PurrCRM checks it), and lib/src/logic/carousel.dart walks it.
How it looks is carousel_style.json’s numbers, picked by the words here and in each screen. A word this package does not know reads as unknown, which is drawn as the default; an optional part (a screen’s picture, its background, its choice, a style) that cannot be read is left out rather than losing the whole message.
Members of Carousel
Section titled “Members of Carousel”Carousel.fromJson()
Section titled “Carousel.fromJson()”factory Carousel.fromJson(Map<String, Object?> json)Carousel()
Section titled “Carousel()”const Carousel({required List<CarouselScreen> screens, String start = '', CarouselProgress progress = CarouselProgress.unknown, bool skip = false, CarouselPresentation presentation = CarouselPresentation.unknown, bool locked = false, CarouselStyle? style})locked
Section titled “locked”final bool lockedLeft only through its own buttons: no close, no Skip, no drag down, no tap outside, and the system’s back goes back a screen at most.
presentation
Section titled “presentation”final CarouselPresentation presentationHow it is shown; unknown is a sheet.
progress
Section titled “progress”final CarouselProgress progressWhat the top bar shows of how far the guest is; unknown is dots for one line of at most seven screens, and a bar otherwise.
screens
Section titled “screens”final List<CarouselScreen> screensOne to fifty, in the editor’s order, which is also where a screen’s next goes when it names none.
final bool skipA “Skip” in the top bar in place of the close button.
final String startThe id of the screen it opens on; empty for the first.
final CarouselStyle? styleThe carousel’s look, which each screen’s own overrides field by field; null for the defaults.
CarouselBackground
Section titled “CarouselBackground”class CarouselBackgroundWhat is behind a screen. Words over a colour, a gradient or a picture are drawn white or near-black, whichever reads better, unless a block says otherwise.
Members of CarouselBackground
Section titled “Members of CarouselBackground”CarouselBackground.fromJson()
Section titled “CarouselBackground.fromJson()”factory CarouselBackground.fromJson(Map<String, Object?> json)CarouselBackground()
Section titled “CarouselBackground()”const CarouselBackground({required BackgroundKind kind, String color = '', String color2 = '', int angle = 0, String imageUrl = '', CarouselScrim scrim = CarouselScrim.unknown})final int angleA gradient’s direction in degrees, as CSS’s linear-gradient: 0 runs from the bottom up, 90 from left to right.
final String colorA colour’s, and a gradient’s first stop: a ColorToken’s word or
#rrggbb.
color2
Section titled “color2”final String color2A gradient’s last stop.
imageUrl
Section titled “imageUrl”final String imageUrlAn image background’s https address: a decoration, with no alt.
final BackgroundKind kindfinal CarouselScrim scrimOver an image; unknown is none.
CarouselButton
Section titled “CarouselButton”class CarouselButtonOne of a screen’s buttons.
Members of CarouselButton
Section titled “Members of CarouselButton”CarouselButton.fromJson()
Section titled “CarouselButton.fromJson()”factory CarouselButton.fromJson(Map<String, Object?> json)CarouselButton()
Section titled “CarouselButton()”const CarouselButton({required String id, required String label, required CarouselButtonAction action, ContentButtonStyle style = ContentButtonStyle.unknown, String screen = '', String link = '', CarouselPermission permission = CarouselPermission.unknown})action
Section titled “action”final CarouselButtonAction actionWhat it does (the wire’s do); an action this package does not know
is unknown, and goes where the screen’s next goes.
final String idWhat the receipts call it.
final String labelfinal String linkWhat link opens.
permission
Section titled “permission”final CarouselPermission permissionWhat permission asks the phone for.
screen
Section titled “screen”final String screenWhere screen goes, and where permission goes after asking (empty is the screen’s next): a screen’s id, or “end”.
final ContentButtonStyle styleUnknown is primary.
CarouselChoice
Section titled “CarouselChoice”class CarouselChoiceA question on a screen, answered by tapping its options.
Members of CarouselChoice
Section titled “Members of CarouselChoice”CarouselChoice.fromJson()
Section titled “CarouselChoice.fromJson()”factory CarouselChoice.fromJson(Map<String, Object?> json)CarouselChoice()
Section titled “CarouselChoice()”const CarouselChoice({required List<CarouselOption> options, bool multiple = false})multiple
Section titled “multiple”final bool multipleSeveral may be picked, then Continue goes to the screen’s next; a single choice goes on as soon as one is tapped, to its option’s next.
options
Section titled “options”final List<CarouselOption> optionsTwo to eight.
CarouselImage
Section titled “CarouselImage”class CarouselImageA screen’s hero picture.
Members of CarouselImage
Section titled “Members of CarouselImage”CarouselImage.fromJson()
Section titled “CarouselImage.fromJson()”factory CarouselImage.fromJson(Map<String, Object?> json)CarouselImage()
Section titled “CarouselImage()”const CarouselImage({required String url, required String alt, ImageSize size = ImageSize.unknown, ImageAspect aspect = ImageAspect.unknown, ImageFit fit = ImageFit.unknown, ImageShape shape = ImageShape.unknown})final String altWhat it shows, for a guest who cannot see it.
aspect
Section titled “aspect”final ImageAspect aspectUnknown is auto, cover and rounded.
final ImageFit fitfinal ImageShape shapefinal ImageSize sizeHow tall; unknown is medium (full for image_full).
final String urlAn https address.
CarouselOption
Section titled “CarouselOption”class CarouselOptionOne answer of a choice.
Members of CarouselOption
Section titled “Members of CarouselOption”CarouselOption.fromJson()
Section titled “CarouselOption.fromJson()”factory CarouselOption.fromJson(Map<String, Object?> json)CarouselOption()
Section titled “CarouselOption()”const CarouselOption({required String id, required String label, String emoji = '', String next = ''})final String emojiDrawn before the label; empty for none.
final String idWhat the receipts call it.
final String labelfinal String nextWhere tapping it goes, in a single choice: a screen’s id, “end”, or empty for the screen’s next.
CarouselScreen
Section titled “CarouselScreen”class CarouselScreenOne screen of a carousel.
Members of CarouselScreen
Section titled “Members of CarouselScreen”CarouselScreen.fromJson()
Section titled “CarouselScreen.fromJson()”factory CarouselScreen.fromJson(Map<String, Object?> json)CarouselScreen()
Section titled “CarouselScreen()”const CarouselScreen({required String id, required List<ContentBlock> blocks, CarouselLayout layout = CarouselLayout.unknown, CarouselImage? image, ContentAlign align = ContentAlign.unknown, ContentVAlign valign = ContentVAlign.unknown, CarouselBackground? background, List<CarouselButton> buttons = const <CarouselButton>[], CarouselChoice? choice, String next = '', CarouselStyle? style})final ContentAlign alignStart or center; unknown is the layout’s.
background
Section titled “background”final CarouselBackground? backgroundNull for the sheet’s own.
blocks
Section titled “blocks”final List<ContentBlock> blocksbuttons
Section titled “buttons”final List<CarouselButton> buttonsUp to three, stacked, the first the main one; none gives the screen the package’s Next, or Done where it ends.
choice
Section titled “choice”final CarouselChoice? choiceA question, answered by tapping its options; null for none.
final String idWhat the targets and the receipts call it.
final CarouselImage? imageThe hero picture: above the words (image_top), behind them (image_full), a smaller one above them (centred).
layout
Section titled “layout”final CarouselLayout layoutUnknown is centred.
final String nextWhere Next goes: a screen’s id, “end”, or empty for the screen after this one (the end after the last).
final CarouselStyle? styleOverrides the carousel’s style, field by field.
valign
Section titled “valign”final ContentVAlign valignUnknown is the layout’s.
CarouselStyle
Section titled “CarouselStyle”class CarouselStyleA carousel’s look, or a screen’s over it. Every field is optional: unknown (or empty) is the default, and on a screen, the carousel’s.
Members of CarouselStyle
Section titled “Members of CarouselStyle”CarouselStyle.fromJson()
Section titled “CarouselStyle.fromJson()”factory CarouselStyle.fromJson(Map<String, Object?> json)CarouselStyle()
Section titled “CarouselStyle()”const CarouselStyle({String accent = '', CarouselCorner corner = CarouselCorner.unknown, CarouselButtonShape buttonShape = CarouselButtonShape.unknown, CarouselTextScale textScale = CarouselTextScale.unknown})accent
Section titled “accent”final String accentThe buttons’, the progress’s and the ticks’ colour: a ColorToken’s
word or #rrggbb; empty for the app’s brand.
buttonShape
Section titled “buttonShape”final CarouselButtonShape buttonShapecorner
Section titled “corner”final CarouselCorner cornertextScale
Section titled “textScale”final CarouselTextScale textScaleCarouselStyle over(CarouselStyle? base)This style over base: each field this one sets, and base’s where
it sets none.
Checkin
Section titled “Checkin”class CheckinWhat a check-in answers: the messages to show now, in order.
Members of Checkin
Section titled “Members of Checkin”Checkin.fromJson()
Section titled “Checkin.fromJson()”factory Checkin.fromJson(Map<String, Object?> json)Checkin()
Section titled “Checkin()”const Checkin({List<InAppMessage> messages = const <InAppMessage>[], int unread = 0, int nextCheckinSeconds = 20, bool throttled = false, bool testPhone = false, int unreadNotices = 0, bool sendLinks = false})messages
Section titled “messages”final List<InAppMessage> messagesnextCheckinSeconds
Section titled “nextCheckinSeconds”final int nextCheckinSecondsThe soonest to check in again.
sendLinks
Section titled “sendLinks”final bool sendLinksPurrCRM has not been sent the destinations the check-in’s digest names: the app reports them (OutboundApi.reportLinks), once a run.
testPhone
Section titled “testPhone”final bool testPhoneThe guest is one of staff’s test phones: the app offers to check for tests at once.
throttled
Section titled “throttled”final bool throttledToo soon after the last: nothing was looked at.
unread
Section titled “unread”final int unreadThe messenger’s unread count: staff parts the guest has not read, in every conversation, a chat staff started included.
unreadNotices
Section titled “unreadNotices”final int unreadNoticesThe inbox’s unread count: notices PurrCRM pushed the guest that they have not read, for the bell. 0 from a PurrCRM older than the inbox.
CheckinBody
Section titled “CheckinBody”class CheckinBodyWhat the app says when it checks in.
Members of CheckinBody
Section titled “Members of CheckinBody”CheckinBody.fromJson()
Section titled “CheckinBody.fromJson()”factory CheckinBody.fromJson(Map<String, Object?> json)CheckinBody()
Section titled “CheckinBody()”const CheckinBody({required String appVersion, required CrmPlatform platform, required String sessionId, String timeZone = '', String screen = '', bool holdsForScreens = false, String linksDigest = ''})appVersion
Section titled “appVersion”final String appVersionholdsForScreens
Section titled “holdsForScreens”final bool holdsForScreensWhether the app holds a message meant for some screens
(InAppMessage.screens) until one is on: true once the host has
named a screen this run, so that one that never names any is never
sent a message it would hold for ever.
linksDigest
Section titled “linksDigest”final String linksDigestThe digest of the destinations the host declares (linksDigest), or
empty when it declares none: a CRM that has not been sent them asks
for them (Checkin.sendLinks).
platform
Section titled “platform”final CrmPlatform platformscreen
Section titled “screen”final String screenThe screen the guest is on, for a message aimed at one.
sessionId
Section titled “sessionId”final String sessionIdThe app’s session (the tracker’s), which a large message is shown once in.
timeZone
Section titled “timeZone”final String timeZoneThe phone’s IANA zone, for quiet hours and the guest’s day.
toJson
Section titled “toJson”Map<String, Object?> toJson()DeclaredLink
Section titled “DeclaredLink”class DeclaredLinkOne place in the host a link may go, as the host declares it (CrmHost.links): its name for staff, its path template (/offers/{offer_id}), and optionally its page on the web and its screen’s name.
Members of DeclaredLink
Section titled “Members of DeclaredLink”DeclaredLink.fromJson()
Section titled “DeclaredLink.fromJson()”factory DeclaredLink.fromJson(Map<String, Object?> json)DeclaredLink()
Section titled “DeclaredLink()”const DeclaredLink({required String name, required String path, String webUrl = '', String screen = ''})final String namefinal String pathscreen
Section titled “screen”final String screenwebUrl
Section titled “webUrl”final String webUrltoJson
Section titled “toJson”Map<String, Object?> toJson()ExportReceipt
Section titled “ExportReceipt”class ExportReceiptA message the guest was sent or shown, in their export.
Members of ExportReceipt
Section titled “Members of ExportReceipt”ExportReceipt.fromJson()
Section titled “ExportReceipt.fromJson()”factory ExportReceipt.fromJson(Map<String, Object?> json)ExportReceipt()
Section titled “ExportReceipt()”const ExportReceipt({required String message, required MessageKind kind, String variant = '', DateTime? sentAt, DateTime? seenAt, DateTime? clickedAt, DateTime? dismissedAt, DateTime? completedAt})clickedAt
Section titled “clickedAt”final DateTime? clickedAtcompletedAt
Section titled “completedAt”final DateTime? completedAtdismissedAt
Section titled “dismissedAt”final DateTime? dismissedAtfinal MessageKind kindmessage
Section titled “message”final String messageThe message’s name, as staff called it.
seenAt
Section titled “seenAt”final DateTime? seenAtsentAt
Section titled “sentAt”final DateTime? sentAtvariant
Section titled “variant”final String variantExportSurveyAnswer
Section titled “ExportSurveyAnswer”class ExportSurveyAnswerOne answer, as the question’s words and the answer’s.
Members of ExportSurveyAnswer
Section titled “Members of ExportSurveyAnswer”ExportSurveyAnswer.fromJson()
Section titled “ExportSurveyAnswer.fromJson()”factory ExportSurveyAnswer.fromJson(Map<String, Object?> json)ExportSurveyAnswer()
Section titled “ExportSurveyAnswer()”const ExportSurveyAnswer({required String question, required String answer})answer
Section titled “answer”final String answerquestion
Section titled “question”final String questionExportSurveyResponse
Section titled “ExportSurveyResponse”class ExportSurveyResponseThe guest’s answers to one survey, in their export.
Members of ExportSurveyResponse
Section titled “Members of ExportSurveyResponse”ExportSurveyResponse.fromJson()
Section titled “ExportSurveyResponse.fromJson()”factory ExportSurveyResponse.fromJson(Map<String, Object?> json)ExportSurveyResponse()
Section titled “ExportSurveyResponse()”const ExportSurveyResponse({required String survey, required List<ExportSurveyAnswer> answers, required DateTime startedAt, DateTime? completedAt})answers
Section titled “answers”final List<ExportSurveyAnswer> answerscompletedAt
Section titled “completedAt”final DateTime? completedAtstartedAt
Section titled “startedAt”final DateTime startedAtsurvey
Section titled “survey”final String surveyExportTestPhone
Section titled “ExportTestPhone”class ExportTestPhoneThe guest’s account being a test phone, in their export: staff’s name for it, and since when.
Members of ExportTestPhone
Section titled “Members of ExportTestPhone”ExportTestPhone.fromJson()
Section titled “ExportTestPhone.fromJson()”factory ExportTestPhone.fromJson(Map<String, Object?> json)ExportTestPhone()
Section titled “ExportTestPhone()”const ExportTestPhone({String label = '', required DateTime addedAt})addedAt
Section titled “addedAt”final DateTime addedAtfinal String labelExportTestSend
Section titled “ExportTestSend”class ExportTestSendOne test staff sent to the guest’s test phone, in their export: what it was, and what became of it.
Members of ExportTestSend
Section titled “Members of ExportTestSend”ExportTestSend.fromJson()
Section titled “ExportTestSend.fromJson()”factory ExportTestSend.fromJson(Map<String, Object?> json)ExportTestSend()
Section titled “ExportTestSend()”const ExportTestSend({required String name, bool sample = false, required MessageKind kind, required DateTime sentAt, DateTime? pickedUpAt, DateTime? seenAt, DateTime? clickedAt, DateTime? dismissedAt, DateTime? completedAt, String outcome = '', List<ExportSurveyAnswer> answers = const <ExportSurveyAnswer>[]})answers
Section titled “answers”final List<ExportSurveyAnswer> answersclickedAt
Section titled “clickedAt”final DateTime? clickedAtcompletedAt
Section titled “completedAt”final DateTime? completedAtdismissedAt
Section titled “dismissedAt”final DateTime? dismissedAtfinal MessageKind kindfinal String nameThe message’s name, as staff called it, or the built-in sample’s.
outcome
Section titled “outcome”final String outcomeA push’s or a chat’s: sent, notifications_off, not_sent or started.
pickedUpAt
Section titled “pickedUpAt”final DateTime? pickedUpAtWhen the app took an in-app test at a check-in.
sample
Section titled “sample”final bool sampleseenAt
Section titled “seenAt”final DateTime? seenAtsentAt
Section titled “sentAt”final DateTime sentAtInAppBanner
Section titled “InAppBanner”class InAppBannerA strip across the screen.
Members of InAppBanner
Section titled “Members of InAppBanner”InAppBanner.fromJson()
Section titled “InAppBanner.fromJson()”factory InAppBanner.fromJson(Map<String, Object?> json)InAppBanner()
Section titled “InAppBanner()”const InAppBanner({required BannerStyle style, required List<ContentBlock> blocks, bool dismissible = true, String link = ''})blocks
Section titled “blocks”final List<ContentBlock> blocksdismissible
Section titled “dismissible”final bool dismissiblefinal String linkWhere tapping it goes; empty for nowhere.
final BannerStyle styleInAppMessage
Section titled “InAppMessage”class InAppMessageOne in-app message: exactly one of its contents, by kind.
Members of InAppMessage
Section titled “Members of InAppMessage”InAppMessage.fromJson()
Section titled “InAppMessage.fromJson()”factory InAppMessage.fromJson(Map<String, Object?> json)InAppMessage()
Section titled “InAppMessage()”const InAppMessage({required String id, required String variant, required MessageKind kind, InAppBanner? banner, InAppPost? post, Carousel? carousel, Survey? survey, bool test = false, List<String> screens = const <String>[]})banner
Section titled “banner”final InAppBanner? bannercarousel
Section titled “carousel”final Carousel? carouselfinal String idfinal MessageKind kindfinal InAppPost? postscreens
Section titled “screens”final List<String> screensThe host’s screens it is shown on (Crm.screen’s names):
held until one of them is on. Empty for any screen.
survey
Section titled “survey”final Survey? surveyfinal bool testA copy staff sent to a test phone: id is the test’s. Shown at once,
whatever the caps, and what the guest does with it goes back marked
as a test, so it never counts in the message’s report.
variant
Section titled “variant”final String variantWhich of its A/B variants this is; every receipt carries it back.
drawable
Section titled “drawable”bool get drawableWhether the package can draw it: a kind it knows, with its content.
bool get largeWhether it takes the whole screen: a post, a carousel or a large survey. The app shows one of these a session at most.
InAppPost
Section titled “InAppPost”class InAppPostA full-screen message, from a teammate or from the product.
Members of InAppPost
Section titled “Members of InAppPost”InAppPost.fromJson()
Section titled “InAppPost.fromJson()”factory InAppPost.fromJson(Map<String, Object?> json)InAppPost()
Section titled “InAppPost()”const InAppPost({required List<ContentBlock> blocks, Author? sender})blocks
Section titled “blocks”final List<ContentBlock> blockssender
Section titled “sender”final Author? senderOpenMessageBody
Section titled “OpenMessageBody”class OpenMessageBodyThe message a link opened: the session it is shown in.
Members of OpenMessageBody
Section titled “Members of OpenMessageBody”OpenMessageBody.fromJson()
Section titled “OpenMessageBody.fromJson()”factory OpenMessageBody.fromJson(Map<String, Object?> json)OpenMessageBody()
Section titled “OpenMessageBody()”const OpenMessageBody({required String sessionId})sessionId
Section titled “sessionId”final String sessionIdtoJson
Section titled “toJson”Map<String, Object?> toJson()ReceiptBody
Section titled “ReceiptBody”class ReceiptBodyWhat the guest did with a message.
Members of ReceiptBody
Section titled “Members of ReceiptBody”ReceiptBody.fromJson()
Section titled “ReceiptBody.fromJson()”factory ReceiptBody.fromJson(Map<String, Object?> json)ReceiptBody()
Section titled “ReceiptBody()”const ReceiptBody({required String messageId, required String variant, required ReceiptAction action, String link = '', String sessionId = '', bool test = false, String screen = '', String button = '', List<String> answers = const [], List<String> path = const []})action
Section titled “action”final ReceiptAction actionanswers
Section titled “answers”final List<String> answersThe options picked on screen, for answered: one for a single
choice, up to eight for a multiple.
button
Section titled “button”final String buttonA carousel’s button tapped, for clicked (with link too, for a link
button).
final String linkThe link followed, for clicked.
messageId
Section titled “messageId”final String messageIdfinal List<String> pathThe carousel’s screens the guest has seen so far, in order, a screen
seen twice in it twice; at most maxReceiptPath, the first ones kept.
screen
Section titled “screen”final String screenA carousel’s screen: the one answered, the one whose button was tapped, the one it ended or was closed on.
sessionId
Section titled “sessionId”final String sessionIdfinal bool testAbout a test copy (InAppMessage.test): messageId is the test’s.
variant
Section titled “variant”final String varianttoJson
Section titled “toJson”Map<String, Object?> toJson()Survey
Section titled “Survey”class SurveyA survey: steps of questions, one after another, a branch skipping ahead on an answer, ending at a thank-you step or the last.
Members of Survey
Section titled “Members of Survey”Survey.fromJson()
Section titled “Survey.fromJson()”factory Survey.fromJson(Map<String, Object?> json)Survey()
Section titled “Survey()”const Survey({required SurveyFormat format, required List<SurveyStep> steps, List<ContentBlock> intro = const <ContentBlock>[]})format
Section titled “format”final SurveyFormat formatfinal List<ContentBlock> introA large survey’s first screen, before its questions; may be empty.
final List<SurveyStep> stepsquestion
Section titled “question”SurveyQuestion? question(String id)The question with id, or null.
SurveyAnswer
Section titled “SurveyAnswer”class SurveyAnswerOne answer: a number, options, or words, by the question’s type.
Members of SurveyAnswer
Section titled “Members of SurveyAnswer”SurveyAnswer.fromJson()
Section titled “SurveyAnswer.fromJson()”factory SurveyAnswer.fromJson(Map<String, Object?> json)SurveyAnswer()
Section titled “SurveyAnswer()”const SurveyAnswer({required String questionId, int? number, List<String> choices = const <String>[], String other = '', String text = ''})choices
Section titled “choices”final List<String> choicesnumber
Section titled “number”final int? numberfinal String otherThe words with “Other”.
questionId
Section titled “questionId”final String questionIdfinal String textanswered
Section titled “answered”bool get answeredWhether it has anything in it.
toJson
Section titled “toJson”Map<String, Object?> toJson()SurveyAnswerBody
Section titled “SurveyAnswerBody”class SurveyAnswerBodyA survey’s answers so far.
Members of SurveyAnswerBody
Section titled “Members of SurveyAnswerBody”SurveyAnswerBody.fromJson()
Section titled “SurveyAnswerBody.fromJson()”factory SurveyAnswerBody.fromJson(Map<String, Object?> json)SurveyAnswerBody()
Section titled “SurveyAnswerBody()”const SurveyAnswerBody({required String variant, required List<SurveyAnswer> answers, bool test = false})answers
Section titled “answers”final List<SurveyAnswer> answersfinal bool testA test copy’s (InAppMessage.test), by the test’s id.
variant
Section titled “variant”final String varianttoJson
Section titled “toJson”Map<String, Object?> toJson()SurveyBranch
Section titled “SurveyBranch”class SurveyBranchA step’s way forward on an answer: a number in [min, max], or a choice
among values, goes to next.
Members of SurveyBranch
Section titled “Members of SurveyBranch”SurveyBranch.fromJson()
Section titled “SurveyBranch.fromJson()”factory SurveyBranch.fromJson(Map<String, Object?> json)SurveyBranch()
Section titled “SurveyBranch()”const SurveyBranch({required String questionId, required String next, List<String> values = const <String>[], int? min, int? max})final int? maxfinal int? minfinal String nextThe step it goes to, by id.
questionId
Section titled “questionId”final String questionIdvalues
Section titled “values”final List<String> valuesSurveyOption
Section titled “SurveyOption”class SurveyOptionOne option of a choice question.
Members of SurveyOption
Section titled “Members of SurveyOption”SurveyOption.fromJson()
Section titled “SurveyOption.fromJson()”factory SurveyOption.fromJson(Map<String, Object?> json)SurveyOption()
Section titled “SurveyOption()”const SurveyOption({required String id, required String label})final String idfinal String labelSurveyQuestion
Section titled “SurveyQuestion”class SurveyQuestionOne question.
Members of SurveyQuestion
Section titled “Members of SurveyQuestion”SurveyQuestion.fromJson()
Section titled “SurveyQuestion.fromJson()”factory SurveyQuestion.fromJson(Map<String, Object?> json)SurveyQuestion()
Section titled “SurveyQuestion()”const SurveyQuestion({required String id, required QuestionType type, required String title, String description = '', bool required = false, List<SurveyOption> options = const <SurveyOption>[], bool other = false, int min = 0, int max = 0, String minLabel = '', String maxLabel = '', String placeholder = ''})description
Section titled “description”final String descriptionfinal String idfinal int maxmaxLabel
Section titled “maxLabel”final String maxLabelfinal int minA numeric question’s range.
minLabel
Section titled “minLabel”final String minLabelThe words under a scale’s two ends.
options
Section titled “options”final List<SurveyOption> optionsfinal bool otherA choice question offering “Other”, with words of the guest’s own.
placeholder
Section titled “placeholder”final String placeholderrequired
Section titled “required”final bool requiredfinal String titlefinal QuestionType type(int, int) get rangeThe numbers a scaled question is answered with.
SurveyStep
Section titled “SurveyStep”class SurveyStepOne step of a survey.
Members of SurveyStep
Section titled “Members of SurveyStep”SurveyStep.fromJson()
Section titled “SurveyStep.fromJson()”factory SurveyStep.fromJson(Map<String, Object?> json)SurveyStep()
Section titled “SurveyStep()”const SurveyStep({required String id, required SurveyStepKind kind, List<SurveyQuestion> questions = const <SurveyQuestion>[], List<ContentBlock> blocks = const <ContentBlock>[], List<SurveyBranch> branches = const <SurveyBranch>[]})blocks
Section titled “blocks”final List<ContentBlock> blocksWhat a thank-you step says.
branches
Section titled “branches”final List<SurveyBranch> branchesfinal String idfinal SurveyStepKind kindquestions
Section titled “questions”final List<SurveyQuestion> questionsSurveySubmit
Section titled “SurveySubmit”class SurveySubmitA survey finished: every answer on the path the guest took.
Members of SurveySubmit
Section titled “Members of SurveySubmit”SurveySubmit.fromJson()
Section titled “SurveySubmit.fromJson()”factory SurveySubmit.fromJson(Map<String, Object?> json)SurveySubmit()
Section titled “SurveySubmit()”const SurveySubmit({required String variant, required List<SurveyAnswer> answers, bool test = false})answers
Section titled “answers”final List<SurveyAnswer> answersfinal bool testA test copy’s (InAppMessage.test), by the test’s id.
variant
Section titled “variant”final String varianttoJson
Section titled “toJson”Map<String, Object?> toJson()carouselEnd
Section titled “carouselEnd”const String carouselEndThe target that ends a carousel. The Go constant is CarouselEnd.
checkinEvery
Section titled “checkinEvery”const Duration checkinEveryThe least time between two check-ins; a sooner one is answered throttled. The Go constant is CheckinEvery.
maxCarouselScreens
Section titled “maxCarouselScreens”const int maxCarouselScreensThe most screens a carousel has. The Go constant is MaxCarouselScreens.
maxLongAnswerRunes
Section titled “maxLongAnswerRunes”const int maxLongAnswerRunesThe longest long answer. The Go constant is MaxLongAnswerRunes.
maxOtherRunes
Section titled “maxOtherRunes”const int maxOtherRunesThe longest words for “Other”. The Go constant is MaxOtherRunes.
maxReceiptPath
Section titled “maxReceiptPath”const int maxReceiptPathThe most screens a receipt’s path names. The Go constant is MaxReceiptPath.
maxShortAnswerRunes
Section titled “maxShortAnswerRunes”const int maxShortAnswerRunesThe longest short answer. The Go constant is MaxShortAnswerRunes.
otherOption
Section titled “otherOption”const String otherOptionThe option id of “Other” on a choice question that allows it. The Go constant is OtherOption.