Skip to main content

hatang_chat 0.2.2 copy "hatang_chat: ^0.2.2" to clipboard
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-define values (dart pub unpack hatang_chat, then flutter run in example/).

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 #0ea5e9 it 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, contrastRatio and readableOn expose the rule; set onMineBubble to 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 from version.json and the browser from the user agent instead of package_info_plus/device_info_plus, and photos are sent as picked instead of going through flutter_image_compress. Native platforms behave as before.
  • Flutter web could not connect: the SDK sent the whole browser user agent as app.os_version and the gateway rejected the bootstrap (over 40 characters). The web now reports Chrome 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:)): onBuyProduct and onPay hooks so an app can sell through App Store / Play in-app purchase, and showExternalCheckout: false to 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; HatangAttachmentPicker for hosts with their own UI.
  • History: HatangChatInbox (and HatangChat.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: setBottomPadding now 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)), and sdkVersion is generated from pubspec.yaml by the release tooling so they cannot drift.
  • ProductCardItem.appStoreProductId / googlePlayProductId (and hasStoreProduct): the in-app purchase ids a shop sets per product in the dashboard, so onBuyProduct needs no SKU mapping.

0.1.0 - 2026-09-28 #

Added #

  • HatangChat.configure with 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).
  • HatangChatScreen and HatangChat.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.state frames 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 /devices endpoints.
  • 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).
0
likes
0
points
730
downloads

Publisher

verified publisherhatang.dev

Weekly Downloads

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.

Repository (GitHub)
View/report issues

Topics

#chat #live-chat #customer-support #messaging #websocket

License

unknown (license)

Dependencies

clock, device_info_plus, file_picker, flutter, flutter_image_compress, flutter_secure_storage, http, http_parser, image_picker, meta, package_info_plus, shared_preferences, url_launcher, web_socket_channel

More

Packages that depend on hatang_chat