hatang_chat 0.2.2
hatang_chat: ^0.2.2 copied to clipboard
Hatang live chat for Flutter apps: a native customer-support chat screen that talks to your Hatang site over REST and WebSocket, with identity, events, presence and push hooks.
Changelog #
All notable changes to hatang_chat are documented here. The format follows
Keep a Changelog and the package uses
Semantic Versioning.
[Unreleased] #
0.2.2 - 2026-09-28 #
Added #
- Screenshots on pub.dev and in the README.
- The example app runs against Hatang's public demo inbox when started
without
--dart-definevalues (dart pub unpack hatang_chat, thenflutter runinexample/).
0.2.1 - 2026-09-27 #
Changed #
- Text on the site colour (your bubbles, filled buttons, badges) is now dark
or white, whichever has the higher contrast, instead of white for most
colours. With the default
#0ea5e9it becomes dark (7:1 instead of 2.8:1). Where the site colour is used as text (quick replies, outlined buttons, links, prices) it is darkened or lightened just enough to reach 4.5:1.HatangChatTheme.accentText,contrastRatioandreadableOnexpose the rule; setonMineBubbleto keep white bubble text.
Fixed #
- Card buttons and quick replies use the app's font (
labelLarge) instead of the platform default. - Accessibility: the offline and "connecting" banners meet 4.5:1 contrast, the composer is at least 48 px tall, and order and payment lines wrap instead of overflowing when the text size is doubled.
- The package is WebAssembly-compatible (
flutter build web --wasm): on the web the app version is read fromversion.jsonand the browser from the user agent instead ofpackage_info_plus/device_info_plus, and photos are sent as picked instead of going throughflutter_image_compress. Native platforms behave as before. - Flutter web could not connect: the SDK sent the whole browser user agent as
app.os_versionand the gateway rejected the bootstrap (over 40 characters). The web now reportsChrome 140/Chrome on macOS, and every app field is cut to the gateway's limits on all platforms (locale tags to language-region).
0.2.0 - 2026-09-27 #
Added #
- Cards under the team's messages: product carousel (View opens the product page, Buy prefills the composer), order summary, payment request (VietQR, copyable transfer note, Pay now; paid and expired states), quick replies (newest message only) and the 1–5 star rating with an optional comment.
HatangCommerce(configure(commerce:),HatangConversationView(commerce:)):onBuyProductandonPayhooks so an app can sell through App Store / Play in-app purchase, andshowExternalCheckout: falseto hide the QR code, the transfer note and the web checkout where store rules forbid external payment.- Attachments: an attach button in the composer (camera on phones, photo
library, any file), upload progress on the pending bubble, retry that resumes
an unfinished upload, HEIC/HEIF photos converted to JPEG and large photos
scaled to 2048 px before upload, 10 MB and file-type checks before sending.
Received pictures show as thumbnails cached by attachment id (re-signed links
do not re-download) and open in a full-screen viewer with pinch and
double-tap zoom; other files show name and size and open in the system
handler. Expired links are refreshed once per message.
HatangChatController.attach,pickAndSend,pickAndSendImage,pickAndSendFile;HatangAttachmentPickerfor hosts with their own UI. - History:
HatangChatInbox(andHatangChat.openInbox) lists the visitor's conversations with the agent, last message, time, unread count and resolved status, with pull to refresh and paging; tapping one opens it and "New message" returns to the current conversation.HatangChat.open(context, conversationId: …)now opens that conversation (also from a notification on a cold start). Writing into a resolved conversation reopens it; a closed one is read-only. Engine/controller:listConversations,openConversation,openActive. - Embedding:
setBottomPaddingnow moves a chat screen and launcher that are already shown (bottomPaddingListenable); the launcher uses the host's string overrides. The example app has an Embedded tab. - The User-Agent carries the OS version (
hatang-chat-flutter/0.2.0 (ios/18.1; protocol/1)), andsdkVersionis generated from pubspec.yaml by the release tooling so they cannot drift. ProductCardItem.appStoreProductId/googlePlayProductId(andhasStoreProduct): the in-app purchase ids a shop sets per product in the dashboard, soonBuyProductneeds no SKU mapping.
0.1.0 - 2026-09-28 #
Added #
HatangChat.configurewith a site id and app key; the SDK bootstraps a visitor, keeps its token in secure storage and connects to the Hatang gateway over WebSocket (protocol v1).HatangChatScreenandHatangChat.open(context): a full-screen text chat with greeting, away banner, day separators, typing indicator, read receipts, pending/failed bubbles with tap-to-retry and earlier-history paging.- Session API:
identify,setData,pushEvent,setLocale,setScreen,reset,restoreSession,linkTokenFromUri,session. - Streams:
events,unreadCount(+unreadCountListenable),availability,connectionState. - App lifecycle:
app.stateframes on background/foreground with a delayed socket close and a resume on return. - Push hooks (
setPushToken,clearPushToken,isHatangNotification,handleNotification); device registration is deferred until the gateway ships the/devicesendpoints. - Offline pre-chat form and email request gating, Vietnamese and English strings, light/dark theme derived from the site colour.
Coming #
- Rich cards (products, orders, payments, quick replies, CSAT), attachments and image viewer, inbox of earlier conversations, launcher bubble, embedded conversation view (0.2.0).