appplayer_form_view library

Read-only Flutter viewer for mcp_form documents.

Renders a FormDocument as the ACTUAL paper form — the template's own borders, font effects, shading, tables and images on a white sheet — so both people and LLMs see the document, not its schema. Blocks are tagged (MetaData) for coordinate scans, tappable for inspectors and editors, and the whole sheet captures to PNG.

Classes

FormBlockRef
A tapped block, handed to FormView.onBlockTap — enough for an inspector (properties panel) or an editor to act on.
FormView
Read-only renderer of a FormDocument as the ACTUAL paper form.
FormViewController
Imperative surface for the hosting app / an LLM driver: capture the rendered sheet as PNG bytes.

Functions

formDocumentFromUiDsl(Map<String, dynamic> tree, {String documentId = 'uidsl', String templateId = 'unknown', String templateVersion = '0'}) → FormDocument
Adapts mcp_form's uiDsl render output (a widget-tree JSON: Scaffold → ScrollView → Card(section) → Heading/Text/FormField/ DataTable/Image) back into a typed FormDocument so FormView can render frozen uiDsl artifacts — currently the only tool-surface serialisation that carries form.patch results (per-document table rows etc.). Prefer a real document JSON once the engine exposes one.