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 {}, Map<String, PublishComponentInfo> components = 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 -
components
→ Map<
String, PublishComponentInfo> -
The project's published component definitions, by type name: what
the layouts' calls render (each layout lists the ones it needs,
PublishLayoutInfo.components).
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
-
plugins
→ List<
PluginRef> -
Available on PublishModel, provided by the PublishModelPlugins extension
no setter - 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
canvasIdas 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, Map<String, PublishComponentInfo> ? components, AppIdentity? appIdentity, Breakpoints? breakpoints, DateTime? lastUpdated, Json? extra}) → PublishModel -
fontsOf(
String layoutId) → List< PublishFont> -
The fonts layout
layoutIduses: its own and those of the components it calls. -
layoutIdForCanvas(
String canvasId) → String? -
The layout holding canvas
canvasId. -
layoutIdForScreen(
String? screen) → String? -
The layout holding the screen
screennames: a canvas or layout id, or a canvas name compared without case, spaces, dashes or underscores (sorecord-formopens 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
idnames: 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 whenidnames 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 withautomations(none: the key is removed). -
withPlugins(
List< PluginRef> plugins) → PublishModel -
Available on PublishModel, provided by the PublishModelPlugins extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Object? json) → PublishModel -
Decodes a publish model of schema kPublishSchemaVersion. A map of
any other schema, or with no
schema, is refused: it throws an UnsupportedSchemaException. Otherwise it never throws (JSON that is not a map is an empty model).