feature_flags_toggly 1.10.0
feature_flags_toggly: ^1.10.0 copied to clipboard
Dart package that provides feature flags support for Flutter applications allowing you to enable and disable features easily. Can be used with or without Toggly.io.
1.10.0 #
2026-07-13
Breaking #
- Removed
TogglyConfig.verifySignatures. Signature verification is always performed whenuseSignedDefinitionsis enabled (including when loading flags/variants from a persistence backend). useSignedDefinitionsnow defaults totrue. PassuseSignedDefinitions: falseonly when you intentionally want unsigned definitions.
Added #
TogglyConfig.jwksCacheDuration(default 30 days, minimum 1 minute) to configure JWKS cache TTL.
Changed #
Toggly.debug()masksappKey(last 6 characters) so secrets are not exposed in debug/diagnostics surfaces.
Fixed #
- Invalid persisted signatures fail closed: cache is cleared and
flagDefaultsare used instead of applying tampered flags. - Raw
defs/dataextraction for signature verification is top-level only, matching the JS SDKs — nested keys cannot be used to swap verified bytes for unsigned outer fields. - Empty
signatureorkidvalues are rejected during verification.
1.9.2 #
2026-07-13
Fixed #
- Signature verification now applies the Web Crypto ES256 double SHA-256
digest (
SHA256(SHA256(utf8(defs|timestamp)))), matching Toggly.Definitions, Go, and .NET. A single hash rejected every production signed payload and left apps stuck onflagDefaultswithLast Error: Signature verification failed. - Signed definitions/variants requests keep the raw response body and verify
against the exact
defsJSON substring the server signed (not a re-encoded map), matching .NETGetRawText()/ Go rawDefsbytes.
1.9.1 #
2026-07-13
Fixed #
- Guaranteed first HTTP definitions fetch when live updates are enabled: WebSocket
connectivity and
syncmessages withunchanged: trueno longer suppress polling or refresh until_lastSyncedis set. Prevents cold starts (e.g. iOS inactive splash) from remaining forever on seededflagDefaults. - Clearing in-memory evaluation state on identity/context change also clears
_lastSynced/_lastCheckedso a follow-up fetch is required for the new context.
1.9.0 #
2026-07-11
Added #
TogglyConfig.maxCacheKeysopt-in LRU eviction for identity-scoped flags, variants, and revision cache entries (sidecar index viaTogglyCacheProvider.readCacheLruIndex/writeCacheLruIndex).LruTogglyCacheProviderwrapper applied automatically inToggly.initwhenmaxCacheKeysis a positive integer and acacheProvideris supplied.- Shared
cache_lruhelpers matching the JS@ops-ai/toggly-hooks-typesindex JSON shape.
Changed #
TogglyCacheProvideraddsreadCacheLruIndex/writeCacheLruIndexwith no-op defaults; official cache providers override them to persist the sidecar index.
1.8.0 #
2026-07-07
Changed #
- Definitions revision (ETag) persistence is scoped per evaluation identity
(user, groups, claims — same key as flags/variants) so multiple users on
one app each retain their own
If-None-Matchvalue across cold starts and user switches. setIdentity/setContextclear in-memory evaluation state only; persisted flags, variants, and revisions for other users are kept for switch-back.TogglyRevisionCacheProviderread/write/delete methods now take anidentityparameter (breaking change for custom cache backends).- Rejected definition rollbacks are logged in debug mode only; they no longer
invoke
TogglyConfig.onErrorwhile the SDK keeps cached flags.
Note #
- Upgrading from pre-1.8.0 revision storage (
appKey/environmentonly): official cache providers migrate legacy revision keys on first read. Custom backends should do the same or expect one extra full fetch per identity.
1.7.1 #
2026-07-07
Fixed #
- Anti-rollback for signed definitions now rejects only strictly older
timestamps (
<), not equal ones. Equal timestamps are the same definitions re-served (e.g. cold start without a persisted ETag) and are accepted instead of wiping flags back toflagDefaults. - On a genuine rollback attempt, the SDK keeps the newer cached flags (or
variants), re-emits them to the stream, and returns
cached— it no longer callsclearFeatureFlagsCache()and downgrade to defaults.
1.7.0 #
2026-07-07
Added #
FeatureGateBuilderwidget exposes the resolved gate boolean via abuildercallback for conditional UI (styling, taps) without duplicatingStreamBuilder+evaluateFeatureGateSyncboilerplate.Feature.buildernamed constructor as sugar over the same evaluation path.
1.6.0 #
2026-07-05
Added #
setContext({ identity, groups, claims })for evaluated-signed targeting (User Claims, group rules).- Context-aware cache keys including groups and claims.
1.5.1 #
2026-07-05
Added #
- SDK identity on definitions traffic: User-Agent on server HTTP, custom headers on browser/web HTTP, sdk + sdkVersion query params on WebSocket.
1.5.0 #
2026-07-05
Added #
- ETag-based WebSocket sync: merged definitions revision for all definition fetches (
If-None-Match),?rev=on WebSocket connect, and handling forsync,flags-updated, andsigning-key-updatedmessages. - Optional
TogglyRevisionCacheProviderfor persisting definitions revision across restarts when a cache backend supports it.
Changed #
- WebSocket reconnect uses exponential backoff (5s base, 60s cap) and coalesces refresh callbacks with a 300ms debounce.
- Timer polling is suppressed while the WebSocket is reconnecting.
1.4.0 #
2026-07-03
Added #
TogglyConfig.onErrorreports cache, signature, JWKS, and refresh failures to SDK consumers.featureFlagsStreamand a synchronous feature flag snapshot make Feature widgets reactive to refreshed flag data.
Fixed #
- Preserved last-known-good cached flags during transient signature/JWKS failures so feature content does not disappear silently.
- Reported fresh signed-definition verification failures while clearing invalid fresh data.
1.3.0 #
2026-06-28
Added #
- Device-local post-filter gates (
LocalGate,setLocalGates,notifyLocalGatesChanged,onLocalGatesChanged) that AND worker booleans at read time TogglyConfig.localGatesfor init-time registrationFeaturewidget re-evaluates when local gates change- Pure helpers in
local_gates.dart(applyLocalGate,buildFlagGateIndex, etc.)
1.2.2 #
2026-06-16
Fixed #
- Targeting: pass
identityto/evaluated-signedvia DioqueryParameters(u=) so values are URL-encoded. Embedding raw identity in the request URL could corrupt identities containing+,@,/, or other reserved characters, so targeted users were not matched on the edge worker.
1.2.1 #
2026-06-15
Fixed #
- Packaging:
.pubignorenow excludesbuild/and other transient artifacts so the published archive no longer bundles the local build cache (which had pushed it past pub.dev's 100 MB limit).
Changed #
- Added the
repositoryfield pointing to https://github.com/ops-ai/Toggly.FeatureManagement.
1.2.0 #
2026-05-30
Breaking #
- The SDK no longer bundles
flutter_secure_storageand is now memory-only by default. The internalSecureStorageService/SecureStorageKeys(previously exported) have been removed. - Anonymous device identity is no longer persisted. When no
identityis provided toinit/setIdentity, an ephemeral in-memory id is used; pass a stableidentityfor consistent targeting and offline restart.
Added #
- New typed
TogglyCacheProvidercontract andTogglyConfig.cacheProvider. Supply an implementation to persist flags, variants, and JWKS across app restarts. The controlling app owns where data is stored. - Companion persistence packages:
feature_flags_toggly_secure_storage,feature_flags_toggly_disk,feature_flags_toggly_sqlite,feature_flags_toggly_isar. TogglyFeatureFlagsCache/TogglyVariantsCachecache models are now exported for provider implementations.
Changed #
- ETags are kept in memory only and are no longer persisted (first fetch after a cold start is a full, non-304 response).
- Removed secure-storage background/foreground guards that are no longer needed; memory access is always safe.
Migration #
- Apps needing offline support across restarts should add one of the
feature_flags_toggly_*companion packages (or implementTogglyCacheProvider) and pass it viaTogglyConfig(cacheProvider: ...), along with a stableidentity.
1.1.16 #
2026-04-08
Maintenance #
- Satisfied pub.dev publish checks: bounded runtime dependency versions,
.pubignorefor the local benchmark app (not shipped on pub.dev), top-levelbenchmarks/renamed tobenchmark/for layout consistency, and minor analyzer cleanups intoggly.dart.
1.1.15 #
1.1.11 #
1.1.10 #
1.1.9 #
1.1.8 #
1.1.7 #
2025-02-15
- Fixed bug in check when identity changes.
1.1.6 #
2025-02-15
- Added logic to clear cached feature flags if identity changes.
1.1.5 #
2025-02-15
- Fixed clearing etag as well if deserialization fails or verification fails.
1.1.4 #
2025-02-14
- Clear cached feature flags if cache deserialization or verification fails.
1.1.3 #
2025-02-12
- Return cached feature flags if the API call fails
1.1.2 #
2025-02-07
- Added timestamp verification for signed definitions.
- Added certificate whitelist for signed definitions.
- Added benchmarks for API evaluation.
- Performance improvements.
1.1.1 #
2025-02-05
- Updated documentation to include key rotation information.
1.1.0 #
2025-02-05
- Added support for offline validation of signed definitions.
1.0.9 #
2025-01-25
- Added support for signed definitions.
1.0.8 #
2025-01-23
- Added support for multiple children in Feature widget.
1.0.5 #
2023-06-01
- Better dependencies support.
1.0.4 #
2023-06-01
- Better dependencies support.
1.0.3 #
2022-11-22
- Added static "dispose" method to clear timers & cancel streams.
1.0.2 #
2022-11-22
- More doc comments
1.0.1 #
2022-11-22
- Doc comments
- Fixed Lint issues
- Cleaned unused methods *.featureGateFuture and replaced with *.evaluateFeatureGate
1.0.0 #
2022-11-13
- Toggly & Feature classes
- Allow usage without Toggly service (by providing flagDefaults)
- Allow usage with Toggly service (by providing your App Key & Environment name)
- Feature Gate unit tests
- Documentation
- License