PublishLayout class final

Available extensions
Annotations

Constructors

PublishLayout({required LayoutDocument document, String pageId = '', String projectId = '', List<CanvasBreakpoint> breakpoints = const [], Map<String, String> paths = const {}, Map<String, ScreenRoute> routes = const {}, Json variables = const {}, Json conditions = const {}, List<String> fonts = const [], List<String> apis = const [], ThemeTokens? theme, DateTime? lastUpdated, bool hidden = false, Json extra = const {}})

Properties

apis → List<String>
Ids of the APIs its actions call (PublishModel.apis).
final
breakpoints → List<CanvasBreakpoint>
The project breakpoint each canvas is the design for; empty for a layout of one canvas.
final
canvasIds → List<String>
The canvases, in order (the document's roots).
no setter
conditions → Json
The conditions its canvases use, as published: canvas id → condition id → condition. Read by the runtime's expression engine.
final
document → LayoutDocument
final
extra → Json
Keys this version doesn't model, kept.
final
fonts → List<String>
Ids of the fonts its text uses (PublishModel.fonts).
final
hashCode → int
The hash code for this object.
no setterinherited
hidden → bool
Hidden from the published layouts dashboard.
final
id → String
The layout's id (the document's).
no setter
lastUpdated → DateTime?
When it was last published: a cached copy older than the model's entry for it is stale.
final
logic → LayoutLogic
Its variables and conditions, per canvas (the variables and conditions keys, DESIGN.md §5.1).
no setter
managedSnapshots → Map<String, ManagedSnapshot>

Available on PublishLayout, provided by the PublishLayoutManaged extension

Instance top node id → its snapshot.
no setter
pageId → String
The editor page the layout was published from.
final
paths → Map<String, String>
The URL path pattern of each canvas that has one (guide/:id): canvas id → path.
final
projectId → String
final
routes → Map<String, ScreenRoute>
How each canvas that has one opens from a link: canvas id → its ScreenRoute (the screen beneath it, whether it overlays it).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
theme → ThemeTokens?
The project's theme when the layout was published; null to use the project's (PublishModel.theme).
final
variables → Json
The variables its canvases declare, as published: canvas id → variable id → variable. Read by the runtime's value scope.
final

Methods

breakpointOf(String canvasId) → CanvasBreakpoint?
The breakpoint entry of canvasId, if it has one.
canvasForWidth(double width, [Breakpoints? breakpoints]) → String?
The canvas shown at width: the only canvas of a single-canvas layout, else the one for width by the project's breakpoints (default: Breakpoints.defaults). Null for a layout with no canvas.
conditionsOf(String canvasId) → List<Condition>
The conditions of canvas canvasId.
copyWith({LayoutDocument? document, String? pageId, String? projectId, List<CanvasBreakpoint>? breakpoints, Map<String, String>? paths, Map<String, ScreenRoute>? routes, Json? variables, Json? conditions, List<String>? fonts, List<String>? apis, ThemeTokens? theme, DateTime? lastUpdated, bool? hidden, Json? extra}) → PublishLayout
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
inherited
variablesOf(String canvasId) → List<Variable>
The variables of canvas canvasId.
withManagedSnapshots() → PublishLayout

Available on PublishLayout, provided by the PublishLayoutManaged extension

This layout with its managed index rebuilt from its nodes (what the editor's publish writes); without one when it has no managed instance.

Operators

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

Static Methods

fromJson(Object? json, {Catalog? catalog}) → PublishLayout
Decodes a published layout, its nodes and actions with catalog (default: Catalog.current). A layout of a schema other than kSchemaVersion, or with none, is refused (UnsupportedSchemaException); otherwise it never throws.