Widget guides / Flutter
Chat widget in your Flutter app
Add two Dart files to your app and visitors get a chat that answers questions about matches, teams and players, with stats and your prices. This guide covers every setting, callback and object those files give you.
Checklist:
- Get your operator id, public key, widget origin and the wrapper files from your SensibleStats contact.
- Ask your contact to switch mobile on for your account.
- Add the files and dependencies, create one controller with the signed-in visitor's id, and place the launcher.
- Set
onAddToSlip, then test an add, a duplicate and a reject. - Set
onUnavailable, reload the chat when the visitor signs in or out, and register the Android renderer guard.
1. What your visitors get#
- A chat icon in a bottom corner, with a teaser beside it: a short greeting about a game, often with one of your prices and a few suggested questions.
- A chat sheet where visitors ask in their own words and get answers as text and cards: stats, form, line-ups, standings and your prices.
- Add to slip. A price in the chat carries a button that hands the selection to your code (section 7).
Terms used in this guide:
- Wrapper is the set of Dart files your SensibleStats contact sends you. It shows our chat page
https://your-widget-host/min a WebView, draws the icon and teaser, opens the chat in a bottom sheet and passes messages between the page and your code. You never build the page URL yourself. - Operator id and public key identify your account to our server.
- Widget origin is the address of our server for your account, shown here as
https://your-widget-host. - Teaser is the short greeting bubble above the chat icon.
- Bet slip (or slip) is the list of selections a visitor collects in your app before placing a bet.
- Price is your odds for one selection.
matchOddsIdis your sportsbook's own id for one selection: one outcome of one market.operatorUserIdis your id for the signed-in visitor (section 5).
2. Before you start#
You need three values and the wrapper files from your SensibleStats contact.
| From us | Example | What it is |
|---|---|---|
| Operator id | YOUR_OPERATOR_ID | Your account in our system. Part of every request. |
| Public key | YOUR_PUBLIC_KEY | Identifies your widget. |
| Widget origin | https://your-widget-host | The address the chat page loads from. Must be https. |
| To us | What it is |
|---|---|
| Switch on mobile | Ask your contact to switch mobile on for your account. Until then the chat does not start and reports mobileDisabled (section 11). There is no list of allowed domains for mobile. |
Your app also needs:
| Requirement | Value |
|---|---|
| Flutter | 3.44 or later (Dart ^3.12.1) |
| iOS | 15.0 or later |
| Android | minSdk 24 or later. Renderer-crash recovery needs API 26 or later (section 12). |
| Android permission | android. in AndroidManifest. |
| A signed-in visitor | Required. With no visitor id the chat does not start (section 5). |
3. Add the widget#
Add the files. Put the two Dart files in your app's lib folder, keeping the src folder:
| File | What it is |
|---|---|
lib/ | The file you import. It exports everything in this guide. |
lib/ | The code behind it. Import sensible_stats_chat., not this file. |
The top-level constant wrapperVersion holds the wrapper's version, '1.0.0' today. Quote this
value when you contact us; your contact tells you when to update.
The file exports short names such as UserContext, Position and Sport. If one clashes with a
name in your app, import it with a prefix (import 'package:your_app/sensible_stats_chat.dart' as ss;) and write ss. before every name from it. The samples below use no prefix.
Add the dependencies to pubspec.yaml:
dependencies:
webview_flutter: ^4.14.1
webview_flutter_android: 4.14.1
webview_flutter_wkwebview: ^3.26.2
url_launcher: ^6.3.3webview_flutter_android is pinned to exactly 4.14.1: the Android crash guard in section 12 is
built against that version.
Create the controller once and keep it for the life of the app, in a State.initState or a
singleton. It loads the chat page straight away, before any widget is on screen, so the icon and
teaser are ready when the visitor gets there.
import 'package:flutter/material.dart';
import 'package:your_app/sensible_stats_chat.dart';
SensibleStatsConfig chatConfig(String userId) => SensibleStatsConfig(
baseUrl: 'https://your-widget-host',
operatorId: 'YOUR_OPERATOR_ID',
publicKey: 'YOUR_PUBLIC_KEY',
userContext: UserContext(operatorUserId: userId),
locale: 'en-GB',
greetingMessage: 'hello',
);
class _HomePageState extends State<HomePage> {
late final SensibleStatsChatController _chat;
@override
void initState() {
super.initState();
_chat = SensibleStatsChatController(
config: chatConfig(currentUser.id),
onAddToSlip: _addToSlip,
);
}
@override
void dispose() {
_chat.dispose();
super.dispose();
}
}Names that start with my, My or your, and currentUser and HomePage, stand for your own
code. _addToSlip is in section 7.
Place the icon. SensibleStatsLauncher draws the icon and teaser. Put it last in a Stack that
covers the screen; it aligns itself to a bottom corner inside the safe area.
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
myScreenContent,
SensibleStatsLauncher(controller: _chat),
],
),
);
}There is no sheet widget to place. Tapping the icon calls _chat.open(context), which shows the
chat as a modal bottom sheet over the current route.
Call dispose() when you are done with the controller, as above. It stops its timers and
answers a waiting tapPrice() with null. Every call after it does nothing.
4. Settings#
SensibleStatsConfig holds every setting. Its field names match the web widget's init() keys.
The callbacks are not in the config; they are properties of the controller (end of this section).
Required#
| Field | Type | What it does |
|---|---|---|
baseUrl | String | The widget origin. Must be an https URL with a host, or the controller's constructor throws an ArgumentError. Any path is replaced with /. |
operatorId | String | Your operator id. |
publicKey | String | Your public key. |
userContext | UserContext | The signed-in visitor: UserContext(. See section 5. |
With operatorId or publicKey empty, the chat does not start and reports authFailed.
Visitor, language and time#
| Field | Type | Default | What it does |
|---|---|---|---|
locale | String? | your account's default language (English unless you asked for another) | The language of the chat and its answers, as a language tag, e.g. en-GB, tr. |
timeZone | String? | the device's zone | IANA zone, e.g. Europe/. Kick-off times and day names follow this zone. An unknown zone falls back to the device's. |
oddsFormat | OddsFormat?: decimal, american, fractional | decimal | How prices are written. A visitor who picks a format in the chat's settings keeps their choice. |
Greeting and page#
| Field | Type | Default | What it does |
|---|---|---|---|
greetingMessage | String? | none | Sent once when the page loads; the answer becomes the teaser. Use hello. Without it there is no greeting and no teaser. |
page | PageContext? | none | The screen the visitor is on, so the greeting can lead with it. Section 6. |
placeholder | String? | localized | Text in the empty question box. |
starters | List<String>? | none | Suggested questions shown in an empty chat. A question must not contain |, which separates them. |
Look#
| Field | Type | Default | What it does |
|---|---|---|---|
theme | ChatTheme: auto, light, dark | auto | auto follows the device setting. A visitor who picks a theme in the chat keeps their choice, and the icon follows it. |
colors | ChatColors? | ours | ChatColors(. Section 10. |
logoUrl | String? | our mark | Your logo, shown on the icon and in the chat header. The icon accepts an https:// URL or a data: URL; anything else shows our mark. |
headerTitle | String? | SensibleStats | The chat's title. |
radius | double? | 16 | Corner radius of the chat, in px. Negative or non-finite values are dropped. |
pinIcon | PinIcon?: pin, star, bookmark | pin | The icon visitors tap to follow a match or price. |
launcher | bool | true | false hides our icon and teaser so you draw your own (section 8). |
position | Position: left, right | right | Which bottom corner the icon sits in. |
offset | LauncherOffset | LauncherOffset( | Distance of the icon from the side and from the bottom of the safe area, in logical pixels. |
launcherLabel | String? | "Chat with SensibleStats", localized | The icon's label for screen readers. Blank counts as unset. Until the page answers, the icon's label is English "Open chat". |
Slip, callbacks and events#
| Field | Type | Default | What it does |
|---|---|---|---|
slipSports | List<SlipSport>?: basketball, americanfootball, tennis | none | The sports your onAddToSlip accepts besides football. Section 7. |
eventText | bool | false | Adds the visitor's question text to question_asked events. Answer text is never sent. |
A string setting left null or blank is not sent, and the default applies.
Pass these callbacks to the controller's constructor, or set them later: each is a property you can change at any time.
| Property | Dart type | What it does |
|---|---|---|
onAddToSlip | Future<SlipResult?> Function( | Adds a price to your bet slip. Section 7. |
onTeaser | void Function( | Gives you the teaser to draw yourself. Section 8. |
onUnavailable | void Function( | Tells you the chat cannot start. Section 11. |
onEvent | void Function( | Every widget event, for your own analytics. Section 9. |
onBridgeMessage | void Function( | Every raw message between the page and your app, for debugging. direction is pageToApp or appToPage. An error thrown here is ignored. |
5. The signed-in visitor#
Pass your id for the signed-in visitor in UserContext(operatorUserId: ...). Use a random,
non-guessable id that never changes for that account and that you map to the customer on your side
(a UUID works). Never use a customer number, email address or name: the id comes from the visitor's
device, and anyone who knows it can act as that visitor. Spaces at either end are trimmed.
A signed-in visitor is required in the app. With an empty operatorUserId, the chat does not start,
no icon appears, and onUnavailable receives UnavailableReason.noUser.
With the id, the visitor's chat, followed matches and favourites belong to their account, and the greeting can lead with the teams and markets they bet on.
When the visitor signs in or switches account, call reload with a config for the new id:
_chat.reload(chatConfig(newUserId));When the visitor signs out, reload with an empty id, or dispose() the controller. After the
reload the chat closes, the icon hides and onUnavailable receives noUser:
_chat.reload(chatConfig(''));reload keeps the same controller. It loads the page again for the new visitor and drops anything
not yet delivered to the old page. The teaser clears and the icon hides until the new page is ready;
if the chat sheet was open, it stays open on the new visitor's chat. The new config must have the
same baseUrl origin, or reload throws an ArgumentError.
6. The page the visitor is on#
Tell the chat which screen it sits on and the greeting leads with that game, competition or sport.
Set page in the config, or call setPage when the visitor moves between screens.
_chat.setPage(const PageContext(
sport: Sport.football,
kind: PageKind.match,
matchId: PageId.number(19432556),
));PageContext
| Field | Type | Meaning |
|---|---|---|
sport | Sport: football, basketball, americanfootball, tennis | Required. |
kind | PageKind?: section, competition, match | A sport's front page, a competition page, or a match page. |
matchId | PageId? | Your sportsbook's id for the match on a match page. |
competitionId | PageId? | Your sportsbook's id for the competition on a competition page. |
PageId holds a number or a string: PageId.number(19432556) or PageId.text('abc-123').
Call setPage(null) on a screen that is about no sport. If the visitor has not typed or tapped
anything yet, the chat greets again for the new page.
setPage only tells the page that is loaded now. After reload the chat starts from config.page,
so put the current screen in the config you reload with.
7. Add to slip#
The chat shows your prices, each with an "Add to slip" button. This is how a tap reaches your slip:
- The visitor taps "Add to slip" under a price.
- The controller calls
onAddToSlip(selection).selection.matchOddsIdis your sportsbook's own id for that selection, so you can look it up directly. - Your code adds that selection to your slip and returns a
SlipResult. - The chat shows the visitor a short note in their language, such as "Added to slip".
Future<SlipResult?> _addToSlip(Selection selection) async {
final outcome = await mySlip
.add(selection.matchOddsId)
.timeout(const Duration(seconds: 9));
switch (outcome) {
case MySlipOutcome.added:
return SlipResult.added();
case MySlipOutcome.alreadyThere:
return SlipResult.duplicate();
case MySlipOutcome.suspended:
return SlipResult.rejected(RejectReason.suspended);
default:
return SlipResult.rejected(RejectReason.notFound);
}
}You have 10 seconds to answer. No answer in time counts as a failure: the visitor sees "Couldn't add
to slip. Try again." We don't cancel your handler at 10 seconds,
so give your slip call its own timeout under 10 seconds, as above; the TimeoutException it throws is answered with unsupported.
The button shows even when onAddToSlip is not set. A tap then gets rejected with unsupported.
The same happens when your handler throws.
What the controller sends: Selection
| Field | Type | Meaning |
|---|---|---|
matchOddsId | int | Your sportsbook's id for the selection. Look it up in your slip. |
matchId | int | Your sportsbook's id for the match. |
oddsDecimal | double | The price the visitor saw, as a decimal. |
sport | Sport? | null (or football) means football. basketball, americanfootball or tennis otherwise. |
tour | String? | Tennis only: the tour the match id belongs to. |
odds | SlipOdds? | The same price in your account's odds format (not the visitor's own choice): format (e.g. "american") and text (e.g. "+150"). |
quotedAtUtc | String? | ISO time when that price was last confirmed. |
conversationId, insightId | String? | Which chat and which card the tap came from. |
display | SlipDisplay? | The pick in words, for showing only: home, away, kickoffUtc, market, marketLabel, selection, line, player, each a String?. Never price or settle a bet from these. |
Every field after tour is optional: one the page leaves out or sends with the wrong type is null
and never stops the selection reaching you. A selection that lacks matchOddsId, matchId or
oddsDecimal never reaches your handler; the wrapper answers unsupported for you.
What you return: SlipResult
| Return | When | The visitor sees (English) |
|---|---|---|
SlipResult. or null | The selection is in the slip. added also takes slip: SlipSummary(; it is accepted but not shown today. | Added to slip |
SlipResult. | It was already in the slip. | Already in your slip |
SlipResult. | The price moved and you added it at the new price. newOdds is the new price as text; empty text throws an ArgumentError. | Added at 2.10 (was 1.95) |
SlipResult. | The price moved and you did not add it. | Price moved to 2.10 (was 1.95). Tap to add. |
SlipResult. | You did not add it. reason is a RejectReason below; message is optional. | See below |
RejectReason | Meaning | The visitor sees (English) |
|---|---|---|
loginRequired | The visitor must sign in first. | Sign in to add to your slip |
suspended | The market is suspended. | Market suspended |
closed | The market or match is closed, e.g. it has started. | Your message, else "This selection can't be added." |
notFound, limit, unsupported | You don't know this selection; the slip is full or a limit is reached; you don't take this kind of selection. | Your message, else "Couldn't add to slip. Try again." |
Other languages show the same notes, translated. message is your own text, shown as is: write it
in the visitor's language. It is ignored for loginRequired and suspended.
Other sports. Football prices get the button straight away. Basketball, American football and
tennis prices get it only when slipSports lists that sport, so a handler that only knows football
never receives them:
slipSports: [SlipSport.basketball, SlipSport.tennis],For these sports the prices come from our own data, so matchOddsId and matchId are our ids, not
your sportsbook's. Find the selection from display (teams, kick-off, market, selection and line)
and tour for tennis, and return SlipResult.rejected(RejectReason.notFound) when you cannot.
Telling the chat what happened next (optional). These calls help the chat track your slip. Calls made before the page is ready are kept and sent once it is.
| Call | When |
|---|---|
slipRemoved( | The visitor removed a selection from your slip. |
betPlaced( | The visitor placed a bet. Only the selections are required; the rest are optional named arguments, and a non-finite stake or totalOdds is left out. |
matchOpened( | The visitor opened a match screen. matchId is an int. |
SlipRef has matchOddsId (int, required) and sport (Sport?; leave it null for football).
8. The icon and teaser#
By default SensibleStatsLauncher draws the icon and teaser. It shows nothing until the chat page
is ready, hides while the chat sheet is open, and shows nothing when the chat cannot start. The
icon is 56 logical pixels; the teaser is up to 240 wide.
To draw them yourself, in your app's design, set launcher: false in the config. The launcher
widget then draws nothing, and you read the teaser from the controller:
_chat.onTeaser = (teaser) {
if (teaser == null) return myLauncher.hideTeaser();
myLauncher.showTeaser(teaser.text, teaser.asks, teaser.price);
_chat.teaserShown();
};
myLauncher.onIconTap = () => _chat.open(context);onTeaser receives a Teaser when one arrives or changes, and null when it is gone. It is not
called at start-up while there is no teaser. The current teaser is also in _chat.teaser, and the
controller is a ChangeNotifier, so a ListenableBuilder on it rebuilds when the teaser changes.
Show your icon only while _chat.available is true.
Teaser
| Field | Type | Meaning |
|---|---|---|
text | String? | The greeting line. |
asks | List<TeaserAsk> | Suggested questions. Each has index (int) and label (String). Show label; pass index to tapAsk. |
cta | String? | A button label, e.g. "Build a bet". |
price | TeaserPrice? | One price: matchOddsId (int), marketLabel (the market's name), label (the selection's name) and odds (the price as text). |
Call these when the visitor acts on your teaser. Each one that opens the chat needs a
BuildContext under your Navigator.
| Call | When | What the controller does |
|---|---|---|
teaserShown() | You showed the teaser. | Counts it as seen, once per teaser, only while the chat is ready and the sheet is closed. |
tapTeaser( | The visitor tapped the teaser text. | Clears the teaser and opens the chat. |
tapAsk( | The visitor tapped a suggested question. | Clears the teaser, opens the chat and asks it. |
tapCta( | The visitor tapped the button. | Clears the teaser and opens the chat on it. |
tapPrice() | The visitor tapped the price. | Checks the price again, then calls your onAddToSlip. Returns Future<PriceResult?>. |
dismissTeaser() | The visitor closed the teaser. | Clears it; onTeaser( follows. |
Opening the chat by any route also clears the teaser. These calls work while our own launcher is on screen too.
PriceResult has matchOddsId (int), outcome (PriceOutcome) and text (String?, the note
to show the visitor, or null).
outcome is added (the selection is in the slip: added, already there, or added at a new price),
gone (the price is no longer offered), coolOff (too many requests; try again shortly) or failed
(not added: your handler refused it or did not answer).
tapPrice() completes with null when there is no price, when an earlier tap is still waiting,
when the teaser is replaced or dismissed, when no answer comes within 15 seconds, or when the chat
is reloaded or disposed. Our own launcher greys the price out while a tap is waiting and shows
text under it.
9. Events for your analytics#
Every visitor action in the chat is passed to onEvent as a Map<String, Object?>, so you can
forward it to your own analytics. The chat does not check consent; gate your own sending on it.
Every event carries name, at (epoch ms, when it happened), operatorId and widgetVersion, and
when known language, conversationId, operatorUserId and page. A ? marks a field that can be
absent.
| Event | Fields |
|---|---|
widget_open | source? (launcher, bubble, teaser, host, popup), first? |
widget_close | method (button, escape, host for your close(), native, back), tab, answering, openMs? |
bubble_shown, bubble_click, bubble_dismiss | none |
bubble_ask_click | position |
tab_change | from, to, source? (bar, link, auto) |
question_asked | turnId, source, length, text? (only with eventText), method?, chipId?, position?, actionRef?, retryOf?, matchId? |
answer_received | turnId, conversationId, latencyMs, cardTypes, firstByteMs? |
answer_failed | turnId, code |
answer_stopped | turnId |
add_to_slip_click | matchOddsId, matchId, odds, market?, sport?, factKey?, surface?, turnId? |
add_to_slip_result | the same fields, plus outcome |
pin_click | action (add, remove), target (match, market), matchId?, market?, sport?, surface?, turnId? |
combo_add_click | surface (builder, chat), sport, legs, total, turnId? |
combo_variant_click | surface, sport, legs, total, variant |
combo_swap_click | surface, sport, legs, total |
all_markets_click | matchId, market?, surface |
dashboard_tile_click | entityType, entityId |
sport_switch | sport |
new_conversation | none |
favourite_change | kind, id, outcome, sport?, surface?, before? |
add_to_slip_result.outcome is added, duplicate, price_changed, timeout or the reject reason
you returned, in snake case (login_required, suspended, closed, not_found, limit,
unsupported). timeout covers any failed add, not only a late one. odds in events is always a
decimal number.
tab, from and to are one of chat, live, matches, builder, following, trends,
games, fixtures, standings, squad, records. question_asked.source is one of typed,
starter, action, tile, preset, live_fact, bubble_ask, retry, match_sheet.
10. Colours#
Each theme has four colours, set with ThemeColors. A colour you leave out keeps ours. The dark
theme reads only the dark colours, never the light ones.
| Colour | Used for | Light default | Dark default |
|---|---|---|---|
accent | Your brand colour: links, highlights and the teaser's questions. | #17936a | #37c891 |
cta | Price and "Add to slip" buttons, and the teaser's price and button. | #f5a623 | #ffb638 |
surface | The chat's background, the icon and the teaser. | #ffffff | #141b24 |
ink | Text. | #14181d | #e8edf2 |
Colours must be hex: #rgb, #rrggbb or #rrggbbaa. Any other value is dropped and our colour
applies; in a debug build the console says which one.
Set surface and ink together: the teaser, lines and faint text are then mixed from them.
colors: const ChatColors(
light: ThemeColors(accent: '#0b5fff', cta: '#ffcc00'),
dark: ThemeColors(accent: '#5c93ff', cta: '#ffd633', surface: '#0d1117', ink: '#f0f3f6'),
),ThemeColors has four optional String? fields, accent, cta, surface and ink. ChatColors
has two ThemeColors? fields, light and dark.
Which group the icon uses: the theme the chat page reports (_chat.pageTheme, a PageTheme of
light or dark); before the page reports one, theme from the config, and for auto the
device's brightness.
11. When the chat cannot start#
_chat.available turns true when the page loads, and back to false if our server then refuses
the chat, so the icon can show for a moment before it hides. When the page reports one of the
reasons below, the controller closes the chat sheet (even with one of your dialogs on top of it),
hides the icon, clears the teaser and sets _chat.unavailableReason. It then calls
onUnavailable(reason), once for each new reason: the same reason reported again does not call it
twice. A reason this version of the wrapper does not know only hides the icon.
UnavailableReason | Cause | Fix |
|---|---|---|
noUser | operatorUserId is empty, for example after sign-out. | Start the chat only for a signed-in visitor (section 5). |
mobileDisabled | Mobile is not switched on for your account. | Ask your SensibleStats contact to switch mobile on for your account. |
widgetDisabled | The widget is off for your account, or the operator id is not one we know. | Check the id. If it is right, ask your contact to switch the widget on. |
authFailed | The public key is wrong or empty, or the operator id is empty. | Check both values. |
Errors you can see in your own code:
| Error | Cause |
|---|---|
ArgumentError from the SensibleStatsChatController constructor, "must be an https URL with a host" | baseUrl is not an https URL. |
ArgumentError from reload, "reload() keeps the gateway origin" | The new config has a different baseUrl origin. |
ArgumentError from SlipResult., "must not be empty" | newOdds is empty. |
The controller retries the page once in all. If the page fails to load, it tries again after 1.5
seconds; if it loads but does not become ready within 5 seconds, it loads it again. After that one
retry, a page that still fails leaves the icon hidden until you call reload.
12. Platform notes#
- The chat sheet.
open(context)shows a full-height modal bottom sheet inside the safe area, with a drag handle. Only the handle drags the sheet down, so scrolling the chat never closes it. The page, the visitor's draft and the conversation survive a close. - Back. System back, and a tap on the strip above the sheet, go to the chat first: if the chat has something of its own to close, it does; otherwise the sheet closes within 300 ms.
- Keyboard. The sheet shrinks to stay above the keyboard. Closing the sheet hides the keyboard.
- External links. A link to another site, or a
mailto:ortel:link, opens outside your app throughurl_launcher. Other link types are blocked. The WebView only ever shows our page. - WebView access. On Android, file and content access in the WebView are off. In debug builds the WebView can be inspected (Chrome on Android, Safari on iOS).
- Renderer crashes. The operating system can kill the process that draws a WebView, for example
when memory runs low. The controller then loads the page again and, if the sheet was open,
reopens the chat. If it happens a second time while the same sheet is open, it closes the sheet.
-
iOS recovers this way on its own.
-
Android needs one more file,
RendererGuard.kt, which your SensibleStats contact sends you. Put it in your app's Kotlin source folder, change its first line to your app's package, and register it inMainActivity:import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.engine.FlutterEngine class MainActivity : FlutterActivity() { override fun configureFlutterEngine(flutterEngine: FlutterEngine) { super.configureFlutterEngine(flutterEngine) flutterEngine.plugins.add(RendererGuardPlugin()) } }The guard works on Android 8.0 (API 26) and later. Without the file, or on older versions, the chat works normally, but a renderer crash is not recovered and Android ends your app.
-
13. Reference#
SensibleStatsChatController is a ChangeNotifier. After dispose() every method does nothing.
Read-only state
| Property | Type | Meaning |
|---|---|---|
available | bool | The chat page is ready. false before then, after reload, and when it cannot start. |
unavailableReason | UnavailableReason? | Why the chat cannot start, or null. |
isOpen | bool | The chat sheet is open. |
teaser | Teaser? | The current teaser, or null. |
pageTheme | PageTheme? | The theme the chat page is showing, light or dark; null until it reports one. |
labels | LauncherLabels? | The icon's and dismiss button's labels in the visitor's language (launcher, dismiss); null until the page sends them. |
config | SensibleStatsConfig | The config in use. |
Methods
| Method | Returns | What it does |
|---|---|---|
open( | Future<void> | Opens the chat sheet. Completes when the sheet closes. Does nothing if it is already open. |
close() | void | Closes the chat sheet. |
reload( | void | Starts again with a new config, for a new visitor (section 5). |
setPage( | void | Sets the page (section 6); null clears it. |
dispose() | void | Stops the controller (section 3). |
slipRemoved(, betPlaced(, matchOpened( | void | Section 7. |
teaserShown(), tapTeaser(, tapAsk(, tapCta(, dismissTeaser() | void | Section 8. |
tapPrice() | Future<PriceResult?> | Section 8. |
Callback properties: section 4. wrapperVersion: section 3.