cf_waiting_room 0.3.2
cf_waiting_room: ^0.3.2 copied to clipboard
Unofficial Flutter widget for integrating with Cloudflare Waiting Room — WebView-based queue gate with native overlay, session timeout, force re-queue flow, and custom UI builders.
0.3.2 #
- fix: restore 60-second non-enterprise grace period in
effectiveSessionTimeout(was accidentally reduced to 10 s in 0.3.1; CHANGELOG and README already documented 60 s, now code matches). - docs: update README install version to
^0.3.2. - docs: correct mock-mode dialog button labels (
"Yes — still in queue"/"No — queue cleared") to match the actualAlertDialogtext. - docs: add Phase-aware error handling table explaining per-phase WebView error behaviour introduced in 0.3.1.
0.3.1 #
- fix: main-frame WebView errors in Phase 2/3 no longer incorrectly fire
onQueueDone(). Error handling is now phase-aware:- Phase 1: error →
onQueueDone()(graceful fallback, existing behaviour). - Phase 2: error → stay in overlay (CF's JS will auto-retry).
- Phase 3: error → restart session timer; never treated as a queue pass.
Previously, a network hiccup after the non-enterprise cookie-clear reload would
trigger
onQueueDone()and silently reset the session timer as if the queue had been re-passed.
- Phase 1: error →
0.3.0 #
- breaking:
sessionTimeoutSecondsandsessionTimeoutHoursremoved fromWaitingRoomConfig— usesessionTimeoutMinutesonly. - feat:
WaitingRoomConfig.isEnterprise— controls session revocation method.true(Enterprise plan): sendsCf-Waiting-Room-Command: revokethrough WebView so the__cfwaitingroom_*cookie is included, freeing the CF slot server-side.false/ unset (Free / Pro / Business): clears WebView cookie jar + cache + localStorage locally, then reloads for CF re-evaluation.
- feat: automatic 60-second grace period added to
effectiveSessionTimeoutwhenisEnterpriseisfalse. CF auto-renews the cookie on every WebView request; the grace ensures it has genuinely expired. SetsessionTimeoutMinutesto your CF session duration — the +60 s is applied internally. - feat:
WaitingRoomConfig.autoReQueue— whenfalse, session timeout only revokes/clears cookie without auto-reloading. Host callskey.currentState?.checkQueueStatus()when ready. - feat:
CFWaitingRoomOverlayWidgetStateis now public — use aGlobalKey<CFWaitingRoomOverlayWidgetState>to callcheckQueueStatus()externally. - feat: session start time persisted to
SharedPreferences(cf_wr_session_start_ms) so the session timer survives app kills and fires correctly on relaunch. - fix: pressing "Force Re-Queue" no longer shows a black screen — widget remounts
from Phase 1 via a
ValueKeythat increments on every re-queue. - chore: example app refactored into a scenario menu with
isEnterprisetoggle and three test scenarios (built-in dialog, custom page, instant re-queue). - chore: example app uses
flutter_dotenvto keep the test URL out of git. - docs: README updated with
isEnterprisesection, plan comparison table, grace period explanation, andautoReQueueusage.
0.2.2 #
- feat: visual customisation parameters for the default Phase 2 overlay.
overlayIcon(Widget?) — brand logo widget shown above the spinner (replaces oldoverlayIconAsset).loadingIcon(Widget?) — widget that replaces theAnimatedRotationhourglass spinner slot.- Accepts any widget:
Image.asset,Image.network, Lottie,SvgPicture, etc. overlayBackgroundColor(Color?) — background colour of the overlay.titleStyle/refreshMessageStyle(TextStyle?) — text styles for the two body lines.
- feat: text labels (
defaultWaitingTitle,waitingRefreshMessage,lastUpdatedPrefix) moved toWaitingRoomConfigfor Firebase Remote Config support. - chore: expanded
.gitignorewith iOS Pods, Android Gradle, build artefacts.
0.2.1 #
- feat: expose default overlay text via constructor parameters on
CFWaitingRoomOverlayWidget.defaultWaitingTitle— fallback title shown when the CF page supplies no<h1>heading.waitingRefreshMessage— body message shown below the ETA in the default overlay.lastUpdatedPrefix— prefix prepended to the last-updated timestamp (default'Last updated: ').- All three parameters are optional; the previous hard-coded English strings are used when omitted.
0.2.0 #
- feat: locale support for queue page requests (
Accept-Languageheader).- New
localeparameter onCFWaitingRoomOverlayWidget(widget-levelLocaleoverride). - New
localefield inWaitingRoomConfig(BCP-47 string, e.g."zh-TW"), ready for Firebase Remote Config. - Resolution order: widget
locale→WaitingRoomConfig.locale→ device system locale (default).
- New
0.1.0 #
- Initial release.
CFWaitingRoomOverlayWidgetwith two-phase WebView/native-overlay approach.WaitingRoomConfigfor Firebase Remote Config integration.QueueWaitingInfodata class passed towaitingOverlayBuilder.forceReQueue()static method with configurablereQueuePageBuilder.- Session timeout callback via
onSessionTimeout. WidgetsBindingObserverlifecycle management (auto-reload on resume).clearCookieOnStarttoggle (訪特權 mode).- Built-in mock HTML asset for development (
isMock: true).