DesignSystem class final

A design system in memory: its manifest, its two documents' text and its component library, whatever loaded them (load: a folder, a publish, an asset bundle; fromJson: one bundle).

Annotations
  • @immutable

Constructors

DesignSystem({required DesignSystemManifest manifest, String design = '', String patterns = '', ComponentLibrary? components})

Properties

components → ComponentLibrary
Its component definitions by type.
final
design → String
DESIGN.md's text: its principles.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
no setter
list → List<DesignSystemComponent>
Its components in the manifest's order (then any others), each with its declaration, one-line purpose and first preview.
no setter
manifest → DesignSystemManifest
final
name → String
no setter
patterns → String
PATTERNS.md's text: how screens are composed.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tokens → ThemeTokens
Its tokens (the theme a site starts from).
no setter

Methods

catalogOver(Catalog base) → Catalog
base with its components' declarations over it: what documents that call them decode with.
componentFiles(String type) → Map<String, String>?
The files that store the component type in this design system's folder, by reference relative to the manifest: its definition and the manifest that lists it. A host writes them where it keeps the system (a folder, a bucket); a system loaded from there afterwards has the component. Null when it has no such component.
libraryUnder(ComponentLibrary site) → ComponentLibrary
The component library of a site that uses it: its components and site's (the site's own of a type wins).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
themeUnder(ThemeTokens site) → ThemeTokens
The theme of a site that uses it: site's own theme merged over its tokens (the site's colors, styles and scales win, key by key).
toJson() → Json
toString() → String
A string representation of this object.
inherited
withComponent(LayoutDocument definition) → DesignSystem
This design system with definition (a component document) added, or in place of the one of its type: in its library, and in the manifest's list as components/<Type>.json when it was not listed. How a block designed after the system was made (on demand, in a session) joins it.

Operators

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

Static Methods

componentRef(String type) → String
Where a component of type is kept, relative to the manifest.
fromJson(Object? json) → DesignSystem
One bundle: {"manifest": {...}, "design": "...", "patterns": "...", "components": {"Button": {...document...}}}, the form a design system is published and shipped as an asset in.
load(Future<String?> read(String ref), {List<String>? problems}) → Future<DesignSystem>
read gives the text of a reference relative to it (null when there is none). The manifest is DesignSystemManifest.fileName; its documents and components are read by their references. problems collects references that could not be read or are not component documents.