PreviewRegistryBuilder class

Generates a $previews registry for a library that declares a @PreviewRegistry() variable, by scanning every library under the package's lib/ for @Preview / @MultiPreview targets.

The output is a standalone library (not a part) so it can declare the prefixed imports needed to reference previews defined across many files. The trigger library imports it and assigns the generated symbol, whose name mirrors the annotated variable (myPreviews$myPreviews):

import 'previews.preview_registry.g.dart';

@PreviewRegistry()
const myPreviews = $myPreviews;

Constructors

PreviewRegistryBuilder()
const

Properties

buildExtensions Map<String, List<String>>
Mapping from input file extension to output file extensions.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildStep buildStep) Future<void>
Generates the outputs for a given BuildStep.
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