configwire_flutter 0.2.3
configwire_flutter: ^0.2.3 copied to clipboard
Flutter companion for the ConfigWire client with SharedPreferences cache and device targeting.
0.2.3 #
- Docs only, no code change:
README.mdaligned with the wire contract and the companion source (stable?b=bucket persistence /<prefix>.<env>.bucketfallback /clearBucket,?userHash=/?country=accepted-but-ignored deprecation, fixed pure-Dart client link). Requiresconfigwire ^0.3.2or later.
0.2.2 #
- Backward compatible with 0.2.x: no migration needed — old calls
compile and behave as before.
ConfigWireFlutter.createConfigWireis restored (deprecated, use your ownConfigWire+cw.configureFlutter()instead), andconfigureFlutteraccepts the legacyprefs:/prefixCache:args again (deprecated, usestore:withSharedPreferencesCacheStoreinstead). An explicit legacyprefs:or non-defaultprefixCache:still governs the install-ID key verbatim, and non-prefs stores keep the 0.2.x stable ID via the prefs fallback instead of going anonymous — existing<prefix>.<env>.userIdkeys are adopted as-is, no reshuffle. - Added:
configureFluttergainsstore: CacheStore?(explicitstore:param > explicit ctor store > auto-attachedSharedPreferencesCacheStore(env: cw.env)honoring legacyprefs:/prefixCache:), so a bareConfigWire(...)plusconfigureFlutter()gets disk persistence and a stable install ID. Stable install IDs via theuser_storehelpers (loadPersistedUserId/savePersistedUserId/clearPersistedUserId/userIdKeyFor/defaultIdGenerator/generateUserId, deprecations lifted) running on the store-owned backend (SharedPreferencesCacheStore.prefs). Only?userHash=<sha256hex16>leaves the device; the server ignoresuserHashfor bucketing/exposure identity (accepted-but-ignored,X-CW-Deprecated-userHashcompat header stamped) and buckets from its daily anonID unless a valid?b=overrides it. - Stable bucket
?b=: the companion persists the server-mintedbucketfirst-write-wins (prefs fallback keeps the 0.2.x stable ID instead of going anonymous) and sends it as?b=on fetch and events, so bucketing survives daily anonID rotation.
0.2.1 #
- Bring-your-own
ConfigWire.configureFlutter(...)extension (lib/src/configwire_flutter.dart): construct your ownConfigWirewith aSharedPreferencesCacheStore, thenawait cw.configureFlutter(...)resolves the install ID + device targeting, callscw.setTargeting, and optionally runscw.ensureInitialized(). Targeting resolves once per instance (first-call-wins; concurrent callers join the in-flight future and later callers no-op) and never throws (persisted-ID I/O swallowed, throwing custom collectors degrade to identity-only). Like the core constructor, configuring never fetches by default (ensureInitialized: false— targeting only, hermetic); passtrueor callcw.ensureInitialized()afterwards for the cache load plus forced fetch.ConfigWireFlutter.createConfigWireis deprecated — constructConfigWiredirectly instead (note the default flip: it fetches unlessensureInitialized: false, whileconfigureFlutteronly targets unlessensureInitialized: true). SharedPreferencesCacheStoreprefs now optional (lib/src/prefs_store.dart): defaults toSharedPreferencesAsync(). When callers supply their ownConfigWirewith a cache store, theprefixCache/prefspassed toconfigureFluttermust match the store's so the userId key lines up withcw.env.- Example + docs migrated to the new flow (
example/lib/init_gate.dart,example/main.dart,README.md); new hermetic suite for the bring-your-own flow (test/flutter_init_test.dart).
0.2.0 #
- Breaking: fetch identity is now userHash-only (via
configwire ^0.3.0:Targeting.toQueryParametersemits?userHash=<sha256Hex16(userId)>). Rawuidis never sent: no?uid=emission and no dual-send (hash-only by design). Migration: no client code change needed unless you depended on?uid=server-side — key rules offUserHashinstead. Supported server:configwire ^0.1.9or later (dual-accept window): upgrade the server first; older servers (<0.1.9) will treat these fetches as anonymous. Floor bumped toconfigwire: ^0.3.0.
0.1.2 #
- Example app (
example/): flag-gated UI driving real widgets fromwelcome_message(String) andnew_checkout(Bool) flags with in-app defaults,connectRealtime/onUpdatelive rebuild without manual fetch,trackExposureat the flag-driven branches, plus a debug panel (fetch status, version, etag, targeting) and an admin-themed shell (config_wire_screen,init_gate,cw_theme,widgets). Platform shells for android, ios, linux, macos, windows, and web soflutter runworks on every target. No library changes.
0.1.1 #
- WASM compatibility: read the app version via
package_info_plus_platform_interfaceinstead ofpackage:package_info_plus/package_info_plus.dart(which unconditionally exports itsdart:ioLinux implementation and cost 10 pub.dev platform points). Runtime behavior is unchanged — thepackage_info_plusplugin still provides the platform implementations. - Factory hardening (
ConfigWireFlutter.createConfigWirenever throws): a throwingidGeneratordegrades to anonymous (pins nothing instead of propagating);collectDevice: falsedefensive-copiescustomAttrsto match thetruepath; device targeting trimsappVersionbefore the+buildstrip.
0.1.0 #
SharedPreferencesCacheStore:SharedPreferencesAsync-backedCacheStorewith per-env key; blocked storage degrades to load-null/save-noop and never throws.- Device targeting collector: platform, build-stripped appVersion, locale/country; customAttrs from explicit input.
- Stable install ID: a 15-char lowercase
[a-z0-9]ID (defaultdefaultIdGenerator) is persisted and sent as?userHash=(sha256Hex16 of the ID) with each fetch. PassidGeneratorto supply the first-run value from your own source; it runs at most once per install.customAttrsrides alongside the install ID and is never persisted. - Prefs keys share the
<prefixCache>.<env>.<suffix>scheme (cachefor values,userIdfor the install ID;prefixCachedefaults to'configwire'). ConfigWireFlutter.createConfigWireone-call factory returning a wiredConfigWire.