ShadcnPreview class final
A Preview that wraps the previewed widget in a ShadcnLayer.
This is useful for testing shadcn widgets in a preview.
Constructors
- ShadcnPreview({String? name, String group = 'Default', Size? size, double? textScaleFactor, WidgetWrapper? wrapper, Brightness? brightness, PreviewLocalizations? localizations, ColorScheme? colorScheme})
-
Creates a ShadcnPreview.
const
Properties
- brightness → Brightness?
-
Sets the initial theme brightness.
finalinherited
- colorScheme → ColorScheme?
-
The color scheme to use for the preview.
final
- group → String
-
The group the preview belongs to.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- localizations → PreviewLocalizations?
-
A callback to return a localization configuration to be applied to the
previewed Widget.
finalinherited
- name → String?
-
A description to be displayed alongside the preview.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → Size?
-
Artificial constraints to be applied to the previewed widget.
finalinherited
- textScaleFactor → double?
-
Applies font scaling to text within the previewed widget.
finalinherited
- theme → PreviewTheme?
-
A callback to return Material and Cupertino theming data to be applied
to the previewed Widget.
finalinherited
- wrapper → WidgetWrapper?
-
Wraps the previewed Widget in a Widget tree.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toBuilder(
) → PreviewBuilder -
Creates a PreviewBuilder initialized with the values set in this preview.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transform(
) → Preview -
Applies a transformation to the current Preview.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
themeBuilder(
) → PreviewThemeData - The theme builder for the ShadcnPreview.