WidgetPreview class

Wraps a Widget, initializing various state and properties to allow for previewing of the Widget in the widget previewer.

WARNING: This interface is not stable and will change.

See also:

  • Preview, an annotation class used to mark functions returning widget previews.

Constructors

WidgetPreview.new({required Widget child, String? name, double? width, double? height, double? textScaleFactor})
Wraps child in a WidgetPreview instance that applies some set of properties.
const

Properties

child → Widget
The Widget to be rendered in the preview.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double?
Artificial height constraint to be applied to the child.
final
name → String?
A description to be displayed alongside the preview.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textScaleFactor → double?
Applies font scaling to text within the child.
final
width → double?
Artificial width constraint to be applied to the child.
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