lexiolab_flutter library

The Flutter layer: the localizations delegate, the widgets, and font registration.

Import this in an app. lexiolab.dart is the framework-free core underneath it, and importing that alone is enough for a pure-Dart test.

Classes

LexioLabClient
LexioLabConfig
LexioLabDeps
LexioLabScope
Wrap the app in this. It owns the client, the poll timer and the lifecycle listener — none of which belong in the core, because interval and visibility policy are host concerns.
LL
The handle a screen holds. Immutable; content is read through the client, so a handle captured in one build renders the release current at the moment t is called.
LLArgumentPart
An interpolated value — the run that needs isolating.
LLArtifact
A content-addressed artifact: path is a CDN-RELATIVE storage key (b/<hex>.json, f/<hex>.<ext>), never a URL.
LLAspect
What a widget can depend on without depending on everything.
LLBindings
LLContentModel
LLContentSnapshot
LLDirection
ONE Directionality over ONE subtree — the opt-in helper. The SDK never forces a direction on the whole app: the app's chrome is the app's business, and MaterialApp.locale already governs it.
LLEmbeddedSnapshot
The build-time snapshot both SDKs embed so the first paint never waits for a network or a disk read. One definition lives in packages/shared/src/schemas/manifest.ts; this mirrors it.
LLEvent
One reported event. Nothing here is an exception — the SDK never throws at the caller, and several of these ("the manifest did not change") are not failures at all.
LLEventCodes
The LL_SDK_* codes, keyed the way the TypeScript object is.
LLFontFetcher
LLFontFile
One font file. Carries no weight, style or unicode-range: the pipeline emits exactly one file per platform per language (manifest-spec.md).
LLFontLoader
The seam a test replaces to count registrations without an engine.
LLFontRegistry
LLIsolate
A bidi isolate, expressed as a WIDGET rather than as Unicode control characters.
LLKeys
Keys the RTL tests use to find a placeholder run structurally rather than by pixel-diffing a golden image.
LLLanguage
LLLanguageSummary
LLLazyFileStorage
Defers the path_provider call until something actually reads the cache, and degrades to memory if the platform refuses.
LLLiteralPart
Translated prose, in the language's own direction.
LLLocalizationsDelegate
LLManifest
LLMessagePart
LLNetworkFontFetcher
The default fetcher.
LLPendingRelease
LLResolvedFont
LLResponse
A response, reduced to what the algorithm actually reads.
LLSegmentAspect
Value-equal on purpose: aspects live in a set inside the element.
LLSegmentScope
Declares which segments a screen needs, so they load when the screen mounts rather than on the first t call inside a list item.
LLSegmentTranslations
A segment-scoped view. Reading one of these is what loads the segment.
LLStatus
LLStatusBuilder
Rebuilds only when the status changes — an update banner, a debug screen.
LLStorage
Async-only, even for an implementation that could answer synchronously — so a first frame can never see something a later one could not (ADR-0024).
LLText
Renders one key, isolating its placeholders.
LLWidgetsLocalizationsDelegate
Opt-in. Without it, Localizations wraps the app in a Directionality derived from Bidi.isRtlLanguage(locale.languageCode) — direction INFERRED FROM THE LOCALE CODE, which is exactly what the manifest contract forbids. Placed first in the delegate list, it shadows the global one.
LLWrite
One key/value write in a commit.

Enums

LLApplyMode
LLBlockedReason
Why the client is refusing a manifest it can see. Cleared by the next manifest it accepts.
LLContentSource
LLEventSeverity
How loud a code is. The development sink prints notice and error; debug and info are for an app's own onEvent handler.
LLFontKind
LLFontState
LLMode
LLSegmentState
LLStorageMode
Where the cache lives.
LLTextDirection

Constants

kFlutterFontFormats → const List<String>
Formats FontLoader can actually register, best first. WOFF2 is absent on purpose: the Flutter engine cannot load it.
kLLStickyNotices → const Set<String>
Codes that surface once on status.notices rather than scrolling past in a log. Mirrors STICKY_NOTICES in sdk-core's events.ts.
kManifestSchemaVersion → const int
The manifest contract version this SDK implements. Mirrors MANIFEST_SCHEMA_VERSION in @ll/shared/manifest-contract.
kSdkVersion → const String
THE version this client reports against a manifest's min_sdk.

Functions

canonicalBundleJson(Map<String, String> bundle) → String
Canonical JSON for a bundle, matching what the pipeline hashes: keys sorted by code point, no whitespace, no trailing newline. Used by tests and by the example app's snapshot tooling.
createFlutterDeps({LLStorageMode storage = LLStorageMode.auto, Client? httpClient, DateTime now()?, Directory? storageDirectory, void warn(String message)?}) → LexioLabDeps
Builds the real dependencies.
familyForHash(String contentHash) → String
A deterministic family name for a content hash.
languageTagOf(Locale locale) → String
The inverse, producing the manifest's spelling.
localeFromLanguageTag(String tag) → Locale
pt-BR → Locale('pt', 'BR'), zh-Hans → a script subtag.
parseEmbeddedSnapshot(String body) → LLEmbeddedSnapshot?
Parses an embedded snapshot from JSON, for apps that ship ll pull output as an asset instead of generated Dart.
resolveArtifactUrl(String base, String path) → String
Resolves a CDN-relative artifact path against a base.
satisfiesMinSdk(String version, String minimum) → bool
Whether version satisfies minimum.
sha256Hash(Uint8List bytes) → Future<String>
SHA-256 over exact bytes, formatted the way the manifest writes it.

Typedefs

LLEventSink = void Function(LLEvent event)
The event channel every layer writes to.
LLFetch = Future<LLResponse> Function(String url, {Map<String, String>? headers})
LLFontLoaderFactory = LLFontLoader Function(String family)
LLHash = Future<String> Function(Uint8List bytes)
SHA-256 over exact bytes, returning sha256:<hex>. null means the host cannot hash: content still renders, but is never persisted unverified.
LLScheduler = void Function(void task())
The only asynchrony primitive the core uses, so a test can drain it by hand.
LLUnsubscribe = void Function()

Exceptions / Errors

LLNetworkException
Thrown by an LLFetch that could not reach the network at all. Every caller catches it; it never reaches the app.