ManagedComponentResolver class

Brings a layout's managed instances to the version their channel offers now (see the library comment), falling back to each instance's snapshot on any failure.

Masters are fetched at most once per masterTtl per component and kept in cache (an offline run uses the last one); versions are immutable, so a cached one is used as is. Every fetch gives up after timeout.

Constructors

ManagedComponentResolver({required ManagedComponentSource source, PublishCache? cache, Duration timeout = const Duration(seconds: 3), Duration masterTtl = const Duration(minutes: 5), String sdkVersion = kCodelesslySdkVersion, DateTime clock()?, void onError(String instanceId, Object error)?})

Properties

cache → PublishCache
final
hashCode → int
The hash code for this object.
no setterinherited
masterTtl → Duration
final
onError → void Function(String instanceId, Object error)?
Told of each failure that kept a snapshot (logging, tests).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sdkVersion → String
final
source → ManagedComponentSource
final
timeout → Duration
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() → void
Forgets the fetched masters: the next resolve asks again.
resolve(PublishLayout layout, {String projectId = '', ThemeTokens? theme}) → Future<PublishLayout>
layout with each managed instance on the version its channel offers project projectId now, built with the instance's customization and theme (the project's tokens); an instance stays on its snapshot when nothing newer applies or anything fails.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

masterKey(String id) → String
versionKey(String id, int n) → String