crm_sdk: screens and widgets
The screens, the overlay and the widgets package:crm_sdk/crm_sdk.dart exports, and the theme they are drawn with.
import 'package:crm_sdk/crm_sdk.dart';| Name | What it is |
|---|---|
CrmArticleScreen | One article: its title, its words, “Was this helpful?”, the articles beside it, and a way to send us a message; its shape standing in for it until it arrives. |
CrmCarouselPresenter | Shows a carousel until it is done. |
CrmCarouselSession | What a presenter tells PurrCRM about a carousel as the guest goes through it, and what it may ask of the host. |
CrmCollection | One collection of articles: what it is about and its articles, its shape standing in for it until it arrives. |
CrmConversationScreen | One conversation in the messenger, or a new one when conversationId is empty: the parts as bubbles, the guest’s on the right in PurrCRM’s accent and staff’s on the left beside their initial and under their first name, in runs, with the time under each run and a line where a day starts; the rating prompt when the conversation asks for one, and the composer at the foot. |
CrmCountBadge | The count of unread replies, on a row or a button: the ground’s colour on the text’s, and drawn for nobody but the eye (the row or the button says the count to a screen reader). |
CrmFlutterCarouselPresenter | The package’s presenter, drawn by Flutter. |
CrmHelpCenter | The help center: a search over every article, pinned under the top bar as the page scrolls, the topics (collections, each with what it is about and how many articles it has) and the popular articles, and, where the messenger is on, a way to send us a message. |
CrmHideLauncher | Hides the launcher while it is mounted: a host puts it on a screen of its own the launcher should not float over (a checkout, a video). |
CrmImageFor | Makes the picture at an https url: by default the cached network image every picture of PurrCRM’s uses, so that a picture precached before a carousel opens is the one it draws. |
CrmInboxList | The guest’s notices, newest first, each with when it came and a dot while it is unread, and a button for older ones while there are more. |
CrmInboxPage | The guest’s inbox as a page of its own, for a host’s bell to open: the CRM’s header with Back and title (“Inbox” when null), and the notices under it (CrmInboxList), read again when pulled down. |
CrmMessengerScreen | The messenger’s first screen: the team’s faces, “Talk to the product’s team”, how soon we usually reply (or when we are back), “Send us a message”, the guest’s open conversations (who wrote last, what, when, and how many replies are unread), the tickets with where each has got to, a few help articles where the help center is on, and the conversations that are closed. |
CrmMotion | How PurrCRM moves: the canvas’s timings and curves, its spring, its stagger and its press, how fast all of it is (speed) and how screens and banners come in, and none at all when the phone has asked for no animations or the speed is off (still). |
CrmNewTicketScreen | A new ticket (PurrCRM’s ticket forms): the guest picks the kind of ticket when there are several (“What is it about?”, each a row with what staff wrote it is for), then fills in its title, a description and the form’s fields, and sends it with the button at the foot. |
CrmNoticeTile | One notice: its title, its body, when it came, and a dot while it is unread. |
CrmNoticesBuilder | Builds with the guest’s inbox (Crm.notices), again whenever it changes: for the count on a host’s bell, or a host’s own inbox. |
CrmOverlay | Shows the in-app messages of the CrmScope’s facade over child: a host puts it over its routes, once, in its MaterialApp’s builder (under the CrmScope, above the Navigator). |
CrmPage | A CRM page in a host’s Navigator of pages (go_router’s): MaterialPage’s route, coming and going as CrmPageRoute does. |
CrmPageRoute | A CRM page pushed on the host’s Navigator (NavigatorCrmNavigator): a MaterialPageRoute that comes and goes in its platform’s own way. |
CrmPreferencesScreen | The preferences screen: each topic a group of switches, one a channel, kept as the guest turns them (the switch moves at once, and goes back with a sentence when PurrCRM does not keep it); a line under the heading that says when they are saved; and the way to turn everything off. |
CrmRadii | PurrCRM’s corner radii, from the smallest part to a sheet. |
CrmRow | One row: something on the left (leading, often a CrmRowIcon), a title and a line under it, and something on the right (trailing: a count, a pill). |
CrmRowGroup | Rows gathered on one rounded surface, with a line between each, under an optional small heading. |
CrmRowIcon | A row’s picture: an icon in a rounded square, tinted. |
CrmSizes | The sizes of PurrCRM’s parts, in logical pixels: the heights of its buttons and rows, its round buttons and icon tiles, and the widths its words are kept to. |
CrmSpacing | The steps PurrCRM is laid out in, in logical pixels. |
CrmTestModeBanner | child, with a small “CRM TEST” ribbon across a corner while the facade is in test mode, as Flutter’s own DEBUG banner is drawn. |
CrmTestPhoneTile | The Test phone group, for a guest staff chose as a test phone (as the last check-in said, Crm.testPhone) and nobody else: “Check for tests now”, which asks PurrCRM at once for the tests sent from PurrCRM site and says what came (Crm.checkNow). |
CrmTheme | PurrCRM’s theme, as a ThemeExtension of the host’s ThemeData. |
CrmTicketScreen | One ticket: its title and where it has got to (CrmTicketStepper), what staff wrote it is for, the fields the guest may see, and the conversation about it with a composer at the foot, waited on as a conversation is. |
CrmTickets | The guest’s tickets, the most recently changed first, each with its ref and where it has got to: read as the page opens, again on coming back from a ticket and when it is pulled down. |
CrmTypography | PurrCRM’s type: the families its explicit styles are set in, and those styles. |
CrmUnreadBuilder | Builds with the messenger’s count of unread replies (Crm.unread), again whenever it changes: for the badge on a host’s own button or row that opens the messenger. 0 with no CrmScope above it. |
NavigatorCrmNavigator | Shows PurrCRM’s pages on the host’s navigatorKey’s Navigator, each as a page of its own pushed over the one the guest is on: a tapped push’s page (open) as well as a tap’s (push), since a Navigator has no place to put one in place of another. |
crmNetworkImage | The picture at url, from the cache PurrCRM’s pictures share. |
CrmArticleScreen
Section titled “CrmArticleScreen”class CrmArticleScreen extends StatefulWidgetOne article: its title, its words, “Was this helpful?”, the articles beside it, and a way to send us a message; its shape standing in for it until it arrives.
Members of CrmArticleScreen
Section titled “Members of CrmArticleScreen”CrmArticleScreen()
Section titled “CrmArticleScreen()”const CrmArticleScreen({Key? key, required String slug})final String slugCrmCarouselPresenter
Section titled “CrmCarouselPresenter”abstract interface class CrmCarouselPresenterShows a carousel until it is done.
Members of CrmCarouselPresenter
Section titled “Members of CrmCarouselPresenter”present
Section titled “present”Future<void> present(NavigatorState navigator, CrmCarouselSession session)Shows session’s carousel over navigator’s routes; done once it has
gone, however it went.
CrmCarouselSession
Section titled “CrmCarouselSession”abstract interface class CrmCarouselSessionWhat a presenter tells PurrCRM about a carousel as the guest goes through it, and what it may ask of the host. The overlay makes one for each carousel it shows.
Members of CrmCarouselSession
Section titled “Members of CrmCarouselSession”askPermission
Section titled “askPermission”Future<bool> Function(CarouselPermission)? get askPermissionAsks the phone for a permission (CrmHost.askPermission): whether it was given. Null when the host cannot, and a permission button then goes on at once.
message
Section titled “message”InAppMessage get messageThe message: its carousel, and whether it is a test copy.
answered
Section titled “answered”void answered({required String screen, required List<String> answers, required List<String> path})A choice on screen answered with answers, options’ ids.
clicked
Section titled “clicked”void clicked({required String screen, required String button, String link, required List<String> path})button of screen tapped (each time), or swiped past where it is
the screen’s main button and does next; link is a link button’s.
completed
Section titled “completed”void completed({required String screen, required List<String> path})Taken to its end on screen.
dismissed
Section titled “dismissed”void dismissed({required String screen, required List<String> path})Closed on screen before its end.
follow
Section titled “follow”void follow(String link)Follows link with nothing said: a link button’s, once the carousel
has said it ended.
openLink
Section titled “openLink”void openLink(String link, {required String screen, required List<String> path, required void Function() close})A link in screen’s words tapped: said (clicked, with the link) and
followed as the content’s rules let it; close takes the carousel
away first when it leads to a place in the product.
void seen({required List<String> path})It is on the screen, opened on the first screen of path.
CrmCollection
Section titled “CrmCollection”class CrmCollection extends StatefulWidgetOne collection of articles: what it is about and its articles, its shape standing in for it until it arrives.
Members of CrmCollection
Section titled “Members of CrmCollection”CrmCollection()
Section titled “CrmCollection()”const CrmCollection({Key? key, required String slug})final String slugCrmConversationScreen
Section titled “CrmConversationScreen”class CrmConversationScreen extends StatelessWidgetOne conversation in the messenger, or a new one when
conversationId is empty: the parts as bubbles, the guest’s on the
right in PurrCRM’s accent and staff’s on the left beside their initial
and under their first name, in runs, with the time under each run and
a line where a day starts; the rating prompt when the conversation asks
for one, and the composer at the foot. The header says how soon we
usually reply; a new one starts with the team saying hello, and the
help bot’s first words and question, when it speaks first.
While it is open the conversation is waited on, so a reply arrives by itself, and what arrives is marked read; the waiting stops while the product is in the background.
Members of CrmConversationScreen
Section titled “Members of CrmConversationScreen”CrmConversationScreen()
Section titled “CrmConversationScreen()”const CrmConversationScreen({Key? key, String conversationId = ''})conversationId
Section titled “conversationId”final String conversationIdCrmCountBadge
Section titled “CrmCountBadge”class CrmCountBadge extends StatelessWidgetThe count of unread replies, on a row or a button: the ground’s colour on the text’s, and drawn for nobody but the eye (the row or the button says the count to a screen reader). Nothing at all for none.
Members of CrmCountBadge
Section titled “Members of CrmCountBadge”CrmCountBadge()
Section titled “CrmCountBadge()”const CrmCountBadge(int count, {Key? key})final int countCrmFlutterCarouselPresenter
Section titled “CrmFlutterCarouselPresenter”final class CrmFlutterCarouselPresenter implements CrmCarouselPresenterThe package’s presenter, drawn by Flutter. See the library’s comment.
Members of CrmFlutterCarouselPresenter
Section titled “Members of CrmFlutterCarouselPresenter”CrmFlutterCarouselPresenter()
Section titled “CrmFlutterCarouselPresenter()”const CrmFlutterCarouselPresenter({TargetPlatform? platform, ImageProvider<Object> Function(String) imageFor = crmNetworkImage})imageFor
Section titled “imageFor”final ImageProvider<Object> Function(String) imageForHow a picture is fetched; PurrCRM’s network cache by default.
platform
Section titled “platform”final TargetPlatform? platformWhose look a sheet has (iOS’s page sheet, or Material’s bottom sheet on anything else); null for the host theme’s platform.
CrmHelpCenter
Section titled “CrmHelpCenter”class CrmHelpCenter extends StatefulWidgetThe help center: a search over every article, pinned under the top bar as the page scrolls, the topics (collections, each with what it is about and how many articles it has) and the popular articles, and, where the messenger is on, a way to send us a message. The topics and the results cross-fade as a search starts and ends, and a thin line runs under the search while one is refined. The shape of the page stands in for it until it arrives; pulled down, it is read again.
Members of CrmHelpCenter
Section titled “Members of CrmHelpCenter”CrmHelpCenter()
Section titled “CrmHelpCenter()”const CrmHelpCenter({Key? key, void Function()? onExit})onExit
Section titled “onExit”final void Function()? onExitWhat Back does when there is no page before this one (the help center opened by a link): the host’s own page, which crmGoRoutes names.
CrmHideLauncher
Section titled “CrmHideLauncher”class CrmHideLauncher extends StatefulWidgetHides the launcher while it is mounted: a host puts it on a screen of its own the launcher should not float over (a checkout, a video).
Members of CrmHideLauncher
Section titled “Members of CrmHideLauncher”CrmHideLauncher()
Section titled “CrmHideLauncher()”const CrmHideLauncher({Key? key, required Widget child})final Widget childCrmImageFor
Section titled “CrmImageFor”typedef CrmImageFor = ImageProvider<Object> Function(String)Makes the picture at an https url: by default the cached network
image every picture of PurrCRM’s uses, so that a picture precached
before a carousel opens is the one it draws.
CrmInboxList
Section titled “CrmInboxList”class CrmInboxList extends StatelessWidgetThe guest’s notices, newest first, each with when it came and a dot
while it is unread, and a button for older ones while there are more. Tapping one marks it read and follows its link
(Crm.openLink), unless onOpen says otherwise. empty is
what an inbox with nothing in it shows, in the host’s words; a first
page on its way shows the shape of a few notices, which cross-fades
into them.
It is a scrolling list of its own, read again when it is pulled down,
unless shrinkWrap, for a host page that scrolls itself.
Members of CrmInboxList
Section titled “Members of CrmInboxList”CrmInboxList()
Section titled “CrmInboxList()”const CrmInboxList({Key? key, required Widget empty, void Function(CrmNotice)? onOpen, bool shrinkWrap = false, EdgeInsetsGeometry? padding})final Widget emptyWhat an empty inbox shows.
onOpen
Section titled “onOpen”final void Function(CrmNotice)? onOpenA notice was tapped, in place of marking it read and following its link.
padding
Section titled “padding”final EdgeInsetsGeometry? paddingAround the list.
shrinkWrap
Section titled “shrinkWrap”final bool shrinkWrapWhether the list sizes itself to its notices and does not scroll.
CrmInboxPage
Section titled “CrmInboxPage”class CrmInboxPage extends StatelessWidgetThe guest’s inbox as a page of its own, for a host’s bell to open: the
CRM’s header with Back and title (“Inbox” when null), and the notices
under it (CrmInboxList), read again when pulled down. An empty inbox
says so (empty, or PurrCRM’s own words); on a tablet the notices keep
to a readable width (CrmSizes.readable) in the middle.
Back goes to the page before, or does onExit where there is none. onOpen is CrmInboxList’s.
Members of CrmInboxPage
Section titled “Members of CrmInboxPage”CrmInboxPage()
Section titled “CrmInboxPage()”const CrmInboxPage({Key? key, String? title, Widget? empty, void Function(CrmNotice)? onOpen, void Function()? onExit})final Widget? emptyonExit
Section titled “onExit”final void Function()? onExitonOpen
Section titled “onOpen”final void Function(CrmNotice)? onOpenfinal String? titleCrmMessengerScreen
Section titled “CrmMessengerScreen”class CrmMessengerScreen extends StatefulWidgetThe messenger’s first screen: the team’s faces, “Talk to the product’s team”, how soon we usually reply (or when we are back), “Send us a message”, the guest’s open conversations (who wrote last, what, when, and how many replies are unread), the tickets with where each has got to, a few help articles where the help center is on, and the conversations that are closed.
Read each time it is opened, again on coming back to it from a conversation, whose replies are then read, and when it is pulled down. The shape of the page stands in for it until it arrives; a home that could not be read again stays, under a floating “Try again”.
Members of CrmMessengerScreen
Section titled “Members of CrmMessengerScreen”CrmMessengerScreen()
Section titled “CrmMessengerScreen()”const CrmMessengerScreen({Key? key, void Function()? onExit})onExit
Section titled “onExit”final void Function()? onExitWhat Back does when there is no page before this one (the messenger opened by a link): the host’s own page, which crmGoRoutes names.
CrmMotion
Section titled “CrmMotion”class CrmMotionHow PurrCRM moves: the canvas’s timings and curves, its spring, its
stagger and its press, how fast all of it is (speed) and how screens
and banners come in, and none at all when the phone has asked for no
animations or the speed is off (still).
Every number is here rather than where it is used, so that a host (and PurrCRM’s site, through its look) can change them in one place, and the native SDKs copy them from one place; the defaults are carousel_style.json’s.
Members of CrmMotion
Section titled “Members of CrmMotion”CrmMotion()
Section titled “CrmMotion()”const CrmMotion({Duration quick = const Duration(milliseconds: 150), Duration standard = const Duration(milliseconds: 250), Duration emphasis = const Duration(milliseconds: 350), Curve enter = Curves.easeOutCubic, Curve exit = Curves.easeInCubic, double settleStiffness = 700, double settleDampingRatio = 0.9, Duration stagger = const Duration(milliseconds: 40), int staggerMost = 6, double rise = 8, double press = 0.97, double? speed, MotionEnter? arrival, BannerMotion? bannerArrival})arrival
Section titled “arrival”final MotionEnter? arrivalHow a sheet, a card and the messenger come in; null for the site’s look’s, and a slide without one.
bannerArrival
Section titled “bannerArrival”final BannerMotion? bannerArrivalHow a banner comes in; null for the site’s look’s, and a slide without one.
final Curve enterWhat comes in eases out.
final Curve exitWhat goes eases in.
final double pressHow small a button or a row is drawn while a finger is down on it.
final double riseHow far, in logical pixels, a card or row rises as it fades in.
settleDampingRatio
Section titled “settleDampingRatio”final double settleDampingRatioHow damped that spring is: 1 settles with no bounce, less overshoots a little.
settleStiffness
Section titled “settleStiffness”final double settleStiffnessHow stiff the spring is that a sheet let go of settles back on (on Android; iOS’s is the carousel spec’s sheet spring), for a mass of one: Material’s default spatial spring.
final double? speedWhat every duration is multiplied by: 1.4 calm, 0.7 brisk, 0 for no motion at all (carousel_style.json’s motion.speeds); null for the site’s look’s, and 1 without one.
staggerMost
Section titled “staggerMost”final int staggerMostThe most cards or rows that wait their turn: those after them come in with the last that waited, so that a long list is never slow.
arrivalOrSlide
Section titled “arrivalOrSlide”MotionEnter get arrivalOrSlideHow a sheet, a card and the messenger come in, set or not.
bannerArrivalOrSlide
Section titled “bannerArrivalOrSlide”BannerMotion get bannerArrivalOrSlideHow a banner comes in, set or not.
emphasis
Section titled “emphasis”Duration get emphasisA state that matters arriving, a message coming up.
Duration get quickA control’s state.
settle
Section titled “settle”SpringDescription get settleThe spring a sheet let go of settles on: settleStiffness and
settleDampingRatio, for a mass of one.
stagger
Section titled “stagger”Duration get staggerHow much later each card or row of a list fades in than the one
before it (staggered).
standard
Section titled “standard”Duration get standardA part of a page swapped, a banner coming in.
copyWith
Section titled “copyWith”CrmMotion copyWith({Duration? quick, Duration? standard, Duration? emphasis, Curve? enter, Curve? exit, double? settleStiffness, double? settleDampingRatio, Duration? stagger, int? staggerMost, double? rise, double? press, double? speed, MotionEnter? arrival, BannerMotion? bannerArrival})Duration of(BuildContext context, Duration duration)duration, or none when nothing moves.
Duration pace(Duration duration)duration at speed.
staggered
Section titled “staggered”Duration staggered(int order)How long the card or row at order in a list waits before it fades
in: stagger for each one before it, up to staggerMost of them.
bool still(BuildContext context)Whether nothing moves: the phone has asked for no animations, or the speed is off.
CrmNewTicketScreen
Section titled “CrmNewTicketScreen”class CrmNewTicketScreen extends StatefulWidgetA new ticket (PurrCRM’s ticket forms): the guest picks the kind of ticket when there are several (“What is it about?”, each a row with what staff wrote it is for), then fills in its title, a description and the form’s fields, and sends it with the button at the foot.
Each field is drawn as a survey’s are (CrmFieldLabel, the host’s own boxes edged in PurrCRM’s accent, CrmChoiceCard): text and number boxes, a list as cards (or a dropdown past five options), yes or no as two cards, and a day from the platform’s date picker. A required field says “Required” quietly beside its label. Nothing is said to be wrong until the guest presses Send; then each problem is under its field (PurrCRM’s own words for one it refused) and the page scrolls to the first, and goes as the guest mends it. A send that did not go is said in a pill over the foot.
Once sent, the page closes and the new ticket’s page opens. forms are
the forms when the page that opens this one has them; it reads them
itself otherwise.
Members of CrmNewTicketScreen
Section titled “Members of CrmNewTicketScreen”CrmNewTicketScreen()
Section titled “CrmNewTicketScreen()”const CrmNewTicketScreen({Key? key, List<TicketForm>? forms})final List<TicketForm>? formsCrmNoticeTile
Section titled “CrmNoticeTile”class CrmNoticeTile extends StatelessWidgetOne notice: its title, its body, when it came, and a dot while it is unread.
Members of CrmNoticeTile
Section titled “Members of CrmNoticeTile”CrmNoticeTile()
Section titled “CrmNoticeTile()”const CrmNoticeTile({Key? key, required CrmNotice notice, required DateTime now, void Function()? onTap})notice
Section titled “notice”final CrmNotice noticefinal DateTime nowAgainst when notice came is said.
final void Function()? onTapCrmNoticesBuilder
Section titled “CrmNoticesBuilder”class CrmNoticesBuilder extends StatelessWidgetBuilds with the guest’s inbox (Crm.notices), again whenever it changes: for the count on a host’s bell, or a host’s own inbox. An empty inbox with no CrmScope above it.
Members of CrmNoticesBuilder
Section titled “Members of CrmNoticesBuilder”CrmNoticesBuilder()
Section titled “CrmNoticesBuilder()”const CrmNoticesBuilder({Key? key, required Widget Function(BuildContext, CrmNotices) builder})builder
Section titled “builder”final Widget Function(BuildContext, CrmNotices) builderCrmOverlay
Section titled “CrmOverlay”class CrmOverlay extends StatefulWidgetShows the in-app messages of the CrmScope’s facade over child: a host
puts it over its routes, once, in its MaterialApp’s builder (under the
CrmScope, above the Navigator).
Members of CrmOverlay
Section titled “Members of CrmOverlay”CrmOverlay()
Section titled “CrmOverlay()”const CrmOverlay({Key? key, required GlobalKey<NavigatorState> navigatorKey, required Widget child, CrmCarouselPresenter carouselPresenter = const CrmFlutterCarouselPresenter(), bool? launcher})carouselPresenter
Section titled “carouselPresenter”final CrmCarouselPresenter carouselPresenterHow a carousel is shown: the package’s, drawn by Flutter in the look
of the host theme’s platform, unless the host names a platform
(CrmFlutterCarouselPresenter(platform: TargetPlatform.iOS)) or a
presenter of its own.
final Widget childlauncher
Section titled “launcher”final bool? launcherWhether the launcher floats over the host’s screens (lib/src/ui/ launcher.dart): true or false whatever the app’s staff set on the CRM’s site, or null for the site’s choice (none until it sets one).
navigatorKey
Section titled “navigatorKey”final GlobalKey<NavigatorState> navigatorKeyThe host’s Navigator, which a full-screen message is pushed on and a survey’s sheet is shown over: its router’s (GoRouter.routerDelegate.navigatorKey), or its MaterialApp’s navigatorKey.
CrmPage
Section titled “CrmPage”class CrmPage<T> extends Page<T>A CRM page in a host’s Navigator of pages (go_router’s): MaterialPage’s
route, coming and going as CrmPageRoute does.
Members of CrmPage
Section titled “Members of CrmPage”CrmPage()
Section titled “CrmPage()”const CrmPage({required Widget child, LocalKey? key, String? name, Object? arguments, String? restorationId, bool arrives = false})arrives
Section titled “arrives”final bool arrivesWhether it comes in as the site’s look says (the messenger’s page).
final Widget childCrmPageRoute
Section titled “CrmPageRoute”class CrmPageRoute<T> extends MaterialPageRoute<T> with _CrmPageTransitions<T>A CRM page pushed on the host’s Navigator (NavigatorCrmNavigator): a MaterialPageRoute that comes and goes in its platform’s own way. See the library’s comment.
Members of CrmPageRoute
Section titled “Members of CrmPageRoute”CrmPageRoute()
Section titled “CrmPageRoute()”CrmPageRoute({required Widget Function(BuildContext) builder, RouteSettings? settings, bool arrives = false})arrives
Section titled “arrives”final bool arrivesWhether it comes in as the site’s look says (the messenger’s page).
CrmPreferencesScreen
Section titled “CrmPreferencesScreen”class CrmPreferencesScreen extends StatefulWidgetThe preferences screen: each topic a group of switches, one a channel, kept as the guest turns them (the switch moves at once, and goes back with a sentence when PurrCRM does not keep it); a line under the heading that says when they are saved; and the way to turn everything off. Pulled down, it reads them again. While they are on their way, their shape stands in for them, and cross-fades into them.
wording is the version of the words the guest agrees under, kept with
each choice: the package’s own by default. onExit is what Back does
when there is no page before it.
Members of CrmPreferencesScreen
Section titled “Members of CrmPreferencesScreen”CrmPreferencesScreen()
Section titled “CrmPreferencesScreen()”const CrmPreferencesScreen({Key? key, void Function()? onExit, String wording = crmPreferencesWording})onExit
Section titled “onExit”final void Function()? onExitwording
Section titled “wording”final String wordingCrmRadii
Section titled “CrmRadii”class CrmRadiiPurrCRM’s corner radii, from the smallest part to a sheet. The defaults are the package’s own.
Members of CrmRadii
Section titled “Members of CrmRadii”CrmRadii()
Section titled “CrmRadii()”const CrmRadii({double tag = 8, double cell = 10, double cellLarge = 12, double rowIcon = 13, double row = 16, double notice = 18, double bubble = 20, double bubbleJoined = 6, double tile = 22, double composer = 24, double card = 24, double hero = 28, double sheet = 32, double pill = 999})bubble
Section titled “bubble”final double bubbleA message’s bubble.
bubbleJoined
Section titled “bubbleJoined”final double bubbleJoinedA bubble’s corner where it joins the one before it in a run.
final double cardA large card.
final double cellA small picture.
cellLarge
Section titled “cellLarge”final double cellLargeA picture in a reply, a chip.
composer
Section titled “composer”final double composerThe composer’s box.
final double heroA post’s picture.
notice
Section titled “notice”final double noticeA banner, a notice, and the tile of an empty state’s icon.
final double pillA pill: chips, tags, the main button.
final double rowA choice’s row.
rowIcon
Section titled “rowIcon”final double rowIconThe rounded square of a row’s icon.
final double sheetA sheet’s top corners.
final double tagA compact tag.
final double tileA group of rows, a card.
cornered
Section titled “cornered”CrmRadii cornered(CarouselCorner? corner)These radii for corner: each grown or shrunk as carousel_style.json
grows or shrinks the part it is most like from soft corners (a tag
and a picture as an image, a row and a group as a tile, a notice and
a bubble as a callout, a card and a post’s picture as a card, a
sheet as a sheet); a pill stays one. Themselves for soft or none.
CrmRow
Section titled “CrmRow”class CrmRow extends StatelessWidgetOne row: something on the left (leading, often a CrmRowIcon), a
title and a line under it, and something on the right (trailing: a
count, a pill). With onTap the whole row is one button, with a
chevron unless chevron is false or there is a trailing.
Members of CrmRow
Section titled “Members of CrmRow”CrmRow()
Section titled “CrmRow()”const CrmRow({Key? key, required String title, String? subtitle, Widget? leading, Widget? trailing, void Function()? onTap, bool chevron = true, Color? titleColor, String? semanticsLabel, Widget? below, double? minHeight, EdgeInsetsGeometry? padding})final Widget? belowA third line under subtitle.
chevron
Section titled “chevron”final bool chevronleading
Section titled “leading”final Widget? leadingminHeight
Section titled “minHeight”final double? minHeightAt least this high; CrmSizes.row, as the canvas’s rows are, when null.
final void Function()? onTappadding
Section titled “padding”final EdgeInsetsGeometry? paddingThe row’s padding: the gutter across and the between step up and down, unless given.
semanticsLabel
Section titled “semanticsLabel”final String? semanticsLabelWhat a screen reader says for the whole row, in place of the drawn words, when they are not enough on their own.
subtitle
Section titled “subtitle”final String? subtitlefinal String titletitleColor
Section titled “titleColor”final Color? titleColorThe title’s colour, for a row that is a warning.
trailing
Section titled “trailing”final Widget? trailingCrmRowGroup
Section titled “CrmRowGroup”class CrmRowGroup extends StatelessWidgetRows gathered on one rounded surface, with a line between each, under an optional small heading.
Members of CrmRowGroup
Section titled “Members of CrmRowGroup”CrmRowGroup()
Section titled “CrmRowGroup()”const CrmRowGroup({Key? key, required List<Widget> children, String? title, String? footer})children
Section titled “children”final List<Widget> childrenfooter
Section titled “footer”final String? footerA sentence under the group.
final String? titleCrmRowIcon
Section titled “CrmRowIcon”class CrmRowIcon extends StatelessWidgetA row’s picture: an icon in a rounded square, tinted.
Members of CrmRowIcon
Section titled “Members of CrmRowIcon”CrmRowIcon()
Section titled “CrmRowIcon()”const CrmRowIcon(IconData icon, {Key? key, Color? color, Color? background})background
Section titled “background”final Color? backgroundfinal Color? colorfinal IconData iconCrmSizes
Section titled “CrmSizes”class CrmSizesThe sizes of PurrCRM’s parts, in logical pixels: the heights of its buttons and rows, its round buttons and icon tiles, and the widths its words are kept to. The defaults are the package’s own.
Members of CrmSizes
Section titled “Members of CrmSizes”CrmSizes()
Section titled “CrmSizes()”const CrmSizes({double pill = 54, double pillCompact = 48, double pillRetry = 46, double pillChip = 44, double roundButton = 44, double target = 48, double topBar = 56, double row = 60, double rowTall = 72, double iconTile = 40, double iconTileSmall = 36, double emptyIcon = 56, double icon = 20, double iconLabel = 19, double iconSmall = 18, double iconTag = 14, double statusPill = 28, double countBadge = 22, double field = 52, double choice = 56, double bubbleMax = 440, double centred = 480, double readable = 560})bubbleMax
Section titled “bubbleMax”final double bubbleMaxThe widest a message’s bubble is, on a phone wider than it needs.
centred
Section titled “centred”final double centredThe widest a page’s centred words are (a survey’s introduction).
choice
Section titled “choice”final double choiceA survey choice’s least height.
countBadge
Section titled “countBadge”final double countBadgeThe count badge’s least side.
emptyIcon
Section titled “emptyIcon”final double emptyIconAn empty state’s icon in its rounded square.
final double fieldA search box’s least height.
final double iconAn icon on its own: in a round button, a chevron that leads on.
iconLabel
Section titled “iconLabel”final double iconLabelAn icon beside a label, in a pill or a banner.
iconSmall
Section titled “iconSmall”final double iconSmallA small icon: a row’s chevron, an error’s mark.
iconTag
Section titled “iconTag”final double iconTagAn icon in a tag or a status pill.
iconTile
Section titled “iconTile”final double iconTileA row’s icon in its rounded square, and a face in a list.
iconTileSmall
Section titled “iconTileSmall”final double iconTileSmallA banner’s icon in its rounded square.
final double pillThe main button: a pill this high.
pillChip
Section titled “pillChip”final double pillChipOne of several choices in a row (the help bot’s buttons).
pillCompact
Section titled “pillCompact”final double pillCompactA button beside words, rather than at a page’s foot (a rating’s Send, “Was this helpful?”, a reply’s button) and the quiet “Not now”.
pillRetry
Section titled “pillRetry”final double pillRetry“Try again” in an empty or error state.
readable
Section titled “readable”final double readableThe widest a column of words reads well at (a post, a survey’s questions).
roundButton
Section titled “roundButton”final double roundButtonThe circle of a round icon button.
final double rowThe least a row is high.
rowTall
Section titled “rowTall”final double rowTallA row with a face and two lines (a conversation).
statusPill
Section titled “statusPill”final double statusPillA status pill’s least height.
target
Section titled “target”final double targetThe least a finger is given round a round button, and the slot a top bar keeps for one so that its title stays centred.
topBar
Section titled “topBar”final double topBarA page’s top bar.
CrmSpacing
Section titled “CrmSpacing”class CrmSpacingThe steps PurrCRM is laid out in, in logical pixels. The defaults are the package’s own; a host passes its own to match its app.
Members of CrmSpacing
Section titled “Members of CrmSpacing”CrmSpacing()
Section titled “CrmSpacing()”const CrmSpacing({double hair = 4, double tight = 6, double chip = 8, double between = 10, double near = 12, double inset = 14, double gutter = 16, double card = 20, double sectionGap = 22, double block = 24, double section = 30})between
Section titled “between”final double betweenCards side by side.
final double blockBetween blocks of one section.
final double cardInside a large card.
final double chipChips in a row, a pair of round buttons.
gutter
Section titled “gutter”final double gutterA page’s side margin, and inside a card.
final double hairAn icon and its word, a tag’s parts.
final double insetInside a small card, and a row’s parts.
final double nearA picture and its name.
section
Section titled “section”final double sectionBetween a page’s sections, where they are given more room than
sectionGap.
sectionGap
Section titled “sectionGap”final double sectionGapBetween the sections of a page: the greeting and each card of the messenger’s home, the groups of rows of the help center.
final double tightA line and the line under it in one block.
CrmTestModeBanner
Section titled “CrmTestModeBanner”class CrmTestModeBanner extends StatelessWidgetchild, with a small “CRM TEST” ribbon across a corner while the
facade is in test mode, as Flutter’s own DEBUG banner is
drawn. Opt in by wrapping the app in it, in the MaterialApp’s builder,
round the overlay and with the same navigator key:
final navigatorKey = GlobalKey<NavigatorState>();
MaterialApp( navigatorKey: navigatorKey, builder: (context, child) => CrmTestModeBanner( child: CrmOverlay(navigatorKey: navigatorKey, child: child!), ),);Debug and profile builds only: a release build draws child alone,
whatever its key, and says so in the log instead (lib/src/core/
test_mode.dart). Nothing either for the live app, or with no CrmScope
above it. The ribbon’s words are for the developer, as DEBUG is, and
are not translated.
Members of CrmTestModeBanner
Section titled “Members of CrmTestModeBanner”CrmTestModeBanner()
Section titled “CrmTestModeBanner()”const CrmTestModeBanner({Key? key, required Widget child, BannerLocation location = BannerLocation.topStart})final Widget childcolor (static)
Section titled “color (static)”static const Color colorThe ribbon’s colour: the orange PurrCRM site marks test mode with.
location
Section titled “location”final BannerLocation locationWhich corner: the top start unless said, so that it is clear of the DEBUG banner at the top end.
message (static)
Section titled “message (static)”static const String messageThe ribbon’s words.
CrmTestPhoneTile
Section titled “CrmTestPhoneTile”class CrmTestPhoneTile extends StatefulWidgetThe Test phone group, for a guest staff chose as a test phone (as the last check-in said, Crm.testPhone) and nobody else: “Check for tests now”, which asks PurrCRM at once for the tests sent from PurrCRM site and says what came (Crm.checkNow). The tests themselves are shown over the screen as any in-app message is, by the CrmOverlay.
Nothing at all for anyone else, and with no CrmScope above it, so a host can put it on its page unconditionally.
Members of CrmTestPhoneTile
Section titled “Members of CrmTestPhoneTile”CrmTestPhoneTile()
Section titled “CrmTestPhoneTile()”const CrmTestPhoneTile({Key? key})CrmTheme
Section titled “CrmTheme”class CrmTheme extends ThemeExtension<CrmTheme>PurrCRM’s theme, as a ThemeExtension of the host’s ThemeData.
Members of CrmTheme
Section titled “Members of CrmTheme”CrmTheme.fromScheme()
Section titled “CrmTheme.fromScheme()”factory CrmTheme.fromScheme(ColorScheme scheme)PurrCRM’s theme from scheme alone: the primary as the accent, and
the rest worked out from the scheme as the canvas works out its
washes (a colour at 10 or 12% over the surface).
CrmTheme()
Section titled “CrmTheme()”const CrmTheme({required Color accent, required Color onAccent, required Color accentTint, required Color controlLine, required Color tagLine, required Color tagInk, required Color ok, required Color okTint, required Color shadow, required Color barLine, CrmSpacing spacing = const CrmSpacing(), CrmRadii radii = const CrmRadii(), CrmSizes sizes = const CrmSizes(), CrmTypography typography = const CrmTypography(), CrmMotion motion = const CrmMotion(), CarouselCorner? corner, CarouselButtonShape? buttonShape, LookDarkMode? darkMode})accent
Section titled “accent”final Color accentWhat PurrCRM draws its own actions in: a message’s buttons, the guest’s bubbles, the composer’s send, the steps done.
accentTint
Section titled “accentTint”final Color accentTintaccent’s wash, behind a banner’s icon or a picked answer.
barLine
Section titled “barLine”final Color barLineThe edge of what floats over a page.
buttonShape
Section titled “buttonShape”final CarouselButtonShape? buttonShapePurrCRM’s buttons’ shape: a pill, or rounded by corner; null for
the site’s look’s, and a pill without one.
controlLine
Section titled “controlLine”final Color controlLineThe edge of a control a finger can change (a choice in a survey), which WCAG asks to stand 3:1 from what is round it.
corner
Section titled “corner”final CarouselCorner? cornerHow round every corner is (radii); null for the site’s look’s, and
soft without one.
darkMode
Section titled “darkMode”final LookDarkMode? darkModeWhether PurrCRM’s screens follow the phone’s dark mode or keep light or dark (CrmLookTheme); null for the site’s look’s, and the host theme’s own brightness without one.
motion
Section titled “motion”final CrmMotion motionfinal Color okSomething that worked (a survey sent, a rating given), and its wash.
okTint
Section titled “okTint”final Color okTintonAccent
Section titled “onAccent”final Color onAccentWords and icons on accent.
shadow
Section titled “shadow”final Color shadowThe shadow under what floats: a floating banner, a sheet.
final CrmSizes sizesspacing
Section titled “spacing”final CrmSpacing spacingtagInk
Section titled “tagInk”final Color tagInktagLine
Section titled “tagLine”final Color tagLineThe edge and the words of a tag that only says what a thing is.
typography
Section titled “typography”final CrmTypography typographybuttonRadius
Section titled “buttonRadius”double? get buttonRadiusA button’s corner radius: null for a pill, else the spec’s for
corner.
CrmRadii get radiiThe corner radii, rounder or squarer by corner.
CrmTheme lerp(CrmTheme? other, double t)The colours blend; the spacing, the corners, the sizes, the type and
the motion are this one’s until halfway, and other’s after.
of (static)
Section titled “of (static)”static CrmTheme of(BuildContext context)The theme’s own, or CrmTheme.fromScheme of its colour scheme when
the host put none in; each part the host left unset (its corner,
buttonShape, its motion’s speed and arrivals) the site’s look’s,
when it set one, and with no CrmTheme of the host’s, the look’s
accent too.
CrmTicketScreen
Section titled “CrmTicketScreen”class CrmTicketScreen extends StatefulWidgetOne ticket: its title and where it has got to (CrmTicketStepper), what staff wrote it is for, the fields the guest may see, and the conversation about it with a composer at the foot, waited on as a conversation is.
Its header is its ref and its type from the moment it opens, where the list it was opened from knew them, and the ticket and its conversation arrive behind one shape of the page.
Members of CrmTicketScreen
Section titled “Members of CrmTicketScreen”CrmTicketScreen()
Section titled “CrmTicketScreen()”const CrmTicketScreen({Key? key, required String ticketId})ticketId
Section titled “ticketId”final String ticketIdCrmTickets
Section titled “CrmTickets”class CrmTickets extends StatefulWidgetThe guest’s tickets, the most recently changed first, each with its ref and where it has got to: read as the page opens, again on coming back from a ticket and when it is pulled down. Their shape stands in for them until they arrive; a list that could not be read again stays, under a floating “Try again”.
When staff let guests open tickets themselves (PurrCRM’s ticket forms), a
“New ticket” pill above the list opens CrmNewTicketScreen; with no
form, or a CRM before them, there is none.
Members of CrmTickets
Section titled “Members of CrmTickets”CrmTickets()
Section titled “CrmTickets()”const CrmTickets({Key? key})CrmTypography
Section titled “CrmTypography”class CrmTypographyPurrCRM’s type: the families its explicit styles are set in, and those styles. Everything else is the host’s TextTheme.
Members of CrmTypography
Section titled “Members of CrmTypography”CrmTypography()
Section titled “CrmTypography()”const CrmTypography({String? displayFamily, String? textFamily})displayFamily
Section titled “displayFamily”final String? displayFamilyHeadings; the host’s default family when null.
textFamily
Section titled “textFamily”final String? textFamilyEverything else; the host’s default family when null.
compactLabel
Section titled “compactLabel”double get compactLabelThe size of a smaller pill’s label (CrmSizes.pillCompact and less): 15, where the main button’s is the theme’s labelLarge.
TextStyle count({Color? color})A count on a badge: 13 on a line of 20, the heaviest weight.
display
Section titled “display”TextStyle display(double size, double lineHeight, FontWeight weight, {double em = 0, Color? color})A style in the display family: size high, lines lineHeight times
that apart, tracked by em of its size.
rowTitle
Section titled “rowTitle”TextStyle? rowTitle(TextTheme styles, {FontWeight weight = FontWeight.w600, Color? color})A row’s title: the host’s titleMedium at 16, semi-bold unless
weight says (an unread conversation’s is heavier).
TextStyle text(double size, double lineHeight, FontWeight weight, {Color? color})A style in the text family.
topBarTitle
Section titled “topBarTitle”TextStyle? topBarTitle(TextTheme styles)A top bar’s title: the host’s titleMedium at 17, its lines 1.2 apart.
CrmUnreadBuilder
Section titled “CrmUnreadBuilder”class CrmUnreadBuilder extends StatelessWidgetBuilds with the messenger’s count of unread replies (Crm.unread), again whenever it changes: for the badge on a host’s own button or row that opens the messenger. 0 with no CrmScope above it.
Members of CrmUnreadBuilder
Section titled “Members of CrmUnreadBuilder”CrmUnreadBuilder()
Section titled “CrmUnreadBuilder()”const CrmUnreadBuilder({Key? key, required Widget Function(BuildContext, int) builder})builder
Section titled “builder”final Widget Function(BuildContext, int) builderNavigatorCrmNavigator
Section titled “NavigatorCrmNavigator”class NavigatorCrmNavigator implements CrmNavigatorShows PurrCRM’s pages on the host’s navigatorKey’s Navigator, each as a
page of its own pushed over the one the guest is on: a tapped push’s
page (open) as well as a tap’s (push), since a Navigator has no
place to put one in place of another. A page whose feature the guest
does not have (Crm.features) is not shown, and open says so. Each
comes and goes in its platform’s way, the predictive back gesture on
Android among it (CrmPageRoute).
The Navigator must be under the host’s CrmScope (a CrmScope above its MaterialApp), which is where the pages find PurrCRM.
Members of NavigatorCrmNavigator
Section titled “Members of NavigatorCrmNavigator”NavigatorCrmNavigator()
Section titled “NavigatorCrmNavigator()”NavigatorCrmNavigator(GlobalKey<NavigatorState> navigatorKey)navigatorKey
Section titled “navigatorKey”final GlobalKey<NavigatorState> navigatorKeyThe Navigator the pages are pushed on: a MaterialApp’s navigatorKey.
crmNetworkImage
Section titled “crmNetworkImage”ImageProvider<Object> crmNetworkImage(String url)The picture at url, from the cache PurrCRM’s pictures share.