PublishModel class final

A published project: its layouts (by id, loaded on their own), entry screen, fonts, theme and APIs.

Available extensions
Annotations
  • @immutable

Constructors

PublishModel({required String projectId, String? slug, String? entryLayoutId, String? entryPageId, String? entryCanvasId, List<String> pages = const [], Map<String, PublishLayoutInfo> layouts = const {}, Map<String, String> layoutIDMap = const {}, List<String> disabledLayouts = const [], List<String> overlayLayoutIds = const [], List<String> backdropLayoutIds = const [], ThemeTokens theme = ThemeTokens.none, Map<String, PublishFont> fonts = const {}, Json apis = const {}, Json variables = const {}, AppIdentity? appIdentity, Breakpoints? breakpoints, DateTime? lastUpdated, Json extra = const {}})

Properties

apis → Json
The APIs the layouts call, as published: api id → API.
final
appIdentity → AppIdentity?
The app's name, screen titles and description, icons, social card, manifest and splash; null when it has none.
final
automations → List<Automation>

Available on PublishModel, provided by the PublishModelAutomations extension

The project's automations, in order.
no setter
backdropLayoutIds → List<String>
The backdrop screens (CanvasProps.backdrop): layouts drawn once beneath every screen of the app, outside navigation, in order (later on top). A layout that is an overlay isn't a backdrop. Listed so an app can show them without loading every layout.
final
backdrops → List<String>
backdropLayoutIds that are published, not disabled and not overlays.
no setter
breakpoints → Breakpoints
The project's breakpoints (DESIGN.md §5.3): which canvas of a screen shows, which variant a responsive layout shows, and ${screen}.
final
disabledLayouts → List<String>
Layouts turned off from the server: not shown.
final
entryCanvasId → String?
final
entryLayoutId → String?
The screen an app opens first when no layout is named.
final
entryPageId → String?
final
extra → Json
Keys this version doesn't model (privacy fields...), kept.
final
fonts → Map<String, PublishFont>
Every font the layouts use, by id.
final
hashCode → int
The hash code for this object.
no setterinherited
lastUpdated → DateTime?
final
layoutIDMap → Map<String, String>
Custom (developer-friendly) layout ids → layout ids. A layout can be named by either.
final
layouts → Map<String, PublishLayoutInfo>
Every published layout, by id.
final
overlayLayoutIds → List<String>
The overlay screens (CanvasProps.overlay): layouts drawn above every screen of the app, outside navigation, in order (later on top). Listed so an app can show them without loading every layout.
final
overlays → List<String>
overlayLayoutIds that are published and not disabled.
no setter
pages → List<String>
The editor pages the layouts come from.
final
projectId → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slug → String?
The project's public slug, if it has one.
final
theme → ThemeTokens
The project's theme.
final
variables → Json
Variables shared by every screen of the app, as published: variable id → variable.
final

Methods

canvas(String canvasId) → PublishCanvas?
Canvas canvasId as listed.
copyWith({String? projectId, String? slug, String? entryLayoutId, String? entryPageId, String? entryCanvasId, List<String>? pages, Map<String, PublishLayoutInfo>? layouts, Map<String, String>? layoutIDMap, List<String>? disabledLayouts, List<String>? overlayLayoutIds, List<String>? backdropLayoutIds, ThemeTokens? theme, Map<String, PublishFont>? fonts, Json? apis, Json? variables, AppIdentity? appIdentity, Breakpoints? breakpoints, DateTime? lastUpdated, Json? extra}) → PublishModel
fontsOf(String layoutId) → List<PublishFont>
The fonts layout layoutId uses.
layoutIdForCanvas(String canvasId) → String?
The layout holding canvas canvasId.
layoutIdForScreen(String? screen) → String?
The layout holding the screen screen names: a canvas or layout id, or a canvas name compared without case, spaces, dashes or underscores (so record-form opens the screen named "Record form"). Null when it names none.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveLayoutId(String? id) → String?
The layout id names: a layout id, a custom id (layoutIDMap) or the id of a canvas in a layout (a link opens a screen by its canvas). Null when id names none, or names a disabled layout.
toJson() → Json
toString() → String
A string representation of this object.
inherited
withAutomations(List<Automation> automations) → PublishModel

Available on PublishModel, provided by the PublishModelAutomations extension

This model with automations (none: the key is removed).

Operators

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

Static Methods

fromJson(Object? json) → PublishModel
Decodes a publish model of any schema, upgrading it first. Never throws.
migratePublishSchema(Json json) → Json
json (a publish model or bundle) upgraded to kPublishSchemaVersion.