Layout
dart
import 'package:vyuh_document/layout.dart';
// also re-exported by package:vyuh_document_editor/document_editor_rendering.dartLayout resolves a document revision into immutable geometry: pages, fragments, lines, carets and hit regions. Paint, hit testing, carets, PDF and print all read that one snapshot. Layout is pure Dart; text measurement comes in through a port the editor implements with Flutter.
Core contracts
| Type | Purpose |
|---|---|
ResolvedDocumentLayout | The immutable geometry of one content revision |
DocumentLayoutGeneration | A layout bound to a document snapshot; ownsCanonicalSnapshot(...), materializeCompleteDocument(...) (used by export) |
DocumentLayoutSession, ContinuousDocumentLayoutSession | Paged and pageless layout sessions |
DocumentMeasurementPort | The text measurement seam (the editor supplies FlutterDocumentMeasurementPort) |
ResolvedBlockLayoutAdapter, ResolvedBlockLayoutAdapterRegistry | How an element contributes its geometry |
Pages and fragments
| Type | Purpose |
|---|---|
ResolvedPageFragment, ResolvedBlockFragment, ResolvedContainerFragment | Placed content |
ResolvedPageRegionFragment, ResolvedPageRegionTemplate | Headers and footers per page |
ResolvedPageFootnoteBand, ResolvedPageEndnoteBand | Note areas |
ResolvedFragmentIndexCatalog | Fragment lookup by page (indexesForPage) |
ResolvedFloatingBlockGeometry | Floating objects |
Interaction geometry
| Type | Purpose |
|---|---|
ResolvedHitRegion, ResolvedPageHitIndex | Pointer hit testing |
ResolvedCaretBox, ResolvedCaretOccurrence, ResolvedCaretLineIndex | Carets and line navigation |
ResolvedPageTextIndex | Text positions on pages |
Generated graphics
ResolvedGeneratedGraphicScene, ResolvedGeneratedGraphicLayoutAdapter and ResolvedGeneratedGraphicPaintArtifact carry Mermaid, KaTeX and diagram scenes from their element packages to every painter.
Integration
layout_integration.dart exposes frozen geometry storage and the occurrence catalog to sibling packages.