PreviewEntry class final
A single entry in the MagicPreviewCatalog.
Each entry pairs a human label and a URL-safe slug with a builder
that renders the component (or component matrix) in isolation. The
generated _previews.g.dart (auto-discovered from *.preview.dart files)
returns a List<PreviewEntry> from a FUNCTION and feeds it to
MagicPreview.register; nothing here is ever a top-level const list, so the
release-mode tree-shaker can prove the whole catalog unreachable when the
dev-only boundary in MagicPreview.registerRoutes folds dead.
- Annotations
Constructors
- PreviewEntry({required String label, required String slug, required WidgetBuilder builder})
-
Creates a preview entry.
const
Properties
- builder → WidgetBuilder
-
Builds the preview body for this entry.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- label → String
-
The display name shown in the catalog sidebar (e.g.
Button).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slug → String
-
The URL-safe identifier used as the
:componentroute segment (e.g.button). Must be unique across the registered set; thepreviews:refreshcodegen (Step 18) collision-checks slugs at build time.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited