ManagedComponentVersion class final

One immutable release of a managed component (managed_components/{id}/versions/{n}).

JSON as stored: {"schema": 3, "id": "sign_in", "version": 3, "semver": "1.1.0", "minSdk": "22.0.0", "payload": "{\"definition\": …, \"contract\": …}", "digest": "9f2c…", "changelog": "…", "createdAt": ms, "createdBy": uid}: payload is the JSON text of the definition and contract and digest the sha256 hex of its UTF-8 bytes. The payload is kept as text so a reader can check the digest over exactly the stored bytes. Decoding also takes definition and contract inline (tests, bundles).

Annotations
  • @immutable

Constructors

ManagedComponentVersion({required String id, required int version, required String semver, required ComponentDefinition definition, ManagedComponentContract contract = const ManagedComponentContract(), String minSdk = '', String changelog = '', String digest = '', String? payload, int? createdAt, Json extra = const {}})
const

Properties

changelog → String
final
contract → ManagedComponentContract
final
createdAt → int?
final
definition → ComponentDefinition
final
digest → String
The sha256 hex digest of payload's UTF-8 bytes.
final
extra → Json
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
The managed component's id.
final
major → int
no setter
minSdk → String
The oldest SDK that can render it; empty for any.
final
payload → String?
The stored payload text, when it was read from one.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semver → String
final
version → int
The version number (the document id): 1, 2, 3… in release order.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
As stored, with payload (or one encoded now) as the body.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

encodePayload(ComponentDefinition definition, ManagedComponentContract contract) → String
The payload text for definition and contract: what a release stores and digests.
fromJson(Object? json, {String? id, int? version}) → ManagedComponentVersion?
Null without an id, a version number, or a definition with a root.