UiSection class

UI section. Typed fields are deprecated; consumers must read the ui/ reserved folder via BundleResources. The original ui: JSON map is preserved verbatim under raw so toJson round-trips.

Constructors

UiSection({String schemaVersion = '1.0.0', Map<String, PageDefinition> pages = const {}, Map<String, WidgetDefinition> widgets = const {}, ThemeConfig? theme, NavigationConfig? navigation, Map<String, StateDefinition> state = const {}, Map<String, dynamic> raw = const {}})
const
UiSection.fromJson(Map<String, dynamic> json)
factory
UiSection.fromPagesList(List<PageDefinition> pages, {String schemaVersion = '1.0.0', Map<String, WidgetDefinition> widgets = const {}, ThemeConfig? theme, NavigationConfig? navigation, Map<String, StateDefinition> state = const {}, Map<String, dynamic> raw = const {}})
Legacy list → map adapter. Generators and consumers that built pages into a List<PageDefinition> (the pre-0.4.0 form) can call this factory directly — the synthesized map uses PageDefinition.id as the key. New code should use the literal map form UiSection(pages: {'id': PageDefinition(...)}).
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
Navigation configuration.
final
pages Map<String, PageDefinition>
Page definitions keyed by id — aligned with the mcp_ui_dsl 1.3 app.schema.json declaration pages: type: object. Routes referencing ui://pages/<id> resolve against this map.
final
raw Map<String, dynamic>
The original ui: JSON map preserved verbatim for round-trip safety. fromJson populates this from the raw input; toJson re-emits it (instead of the deprecated typed fields) so unknown keys and ordering survive a load/save cycle.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schemaVersion String
Schema version for UI section.
final
state Map<String, StateDefinition>
Global UI state definitions.
final
theme ThemeConfig?
Theme configuration.
final
widgets Map<String, WidgetDefinition>
Reusable widget definitions.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Re-emits raw verbatim (the original input) so unknown keys and ordering survive a load → toJson cycle. When raw is empty (constructed in code), falls back to serialising the typed fields for backward compatibility.
toString() String
A string representation of this object.
inherited

Operators

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