RiveWidget class
A widget that displays a Rive artboard.
- The controller parameter is the RiveWidgetController that controls the artboard and state machine. This controller builds on top of the concept of a Rive painter, but provides a more convenient API for building Rive widgets.
- The fit parameter is the fit of the artboard.
- The alignment parameter is the alignment of the artboard.
- The hitTestBehavior parameter is the hit test behavior of the artboard.
- The cursor parameter is the platform/Flutter cursor when interacting with an area that has a
hitTestoftrue. - The layoutScaleFactor parameter is the layout scale factor of the artboard when using
Fit.layout. - The useSharedTexture parameter is whether to use a shared texture (RivePanel) to draw the artboard to.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RiveWidget
Constructors
- RiveWidget({Key? key, required RiveWidgetController controller, Fit fit = RiveDefaults.fit, Alignment alignment = RiveDefaults.alignment, RiveHitTestBehavior hitTestBehavior = RiveDefaults.hitTestBehaviour, MouseCursor cursor = RiveDefaults.mouseCursor, double layoutScaleFactor = RiveDefaults.layoutScaleFactor, int drawOrder = 1})
-
const
Properties
- alignment → Alignment
-
The alignment of the artboard.
final
- controller → RiveWidgetController
-
The controller of the graphic. Manages the artboard, state machine and data binding.
final
- cursor → MouseCursor
-
The cursor of the artboard.
final
- drawOrder → int
-
The draw order of the artboard. This is only used when useSharedTexture
is true when drawing to a RivePanel, and using Factory.rive.
final
- fit → Fit
-
The fit of the artboard.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hitTestBehavior → RiveHitTestBehavior
-
The hit test behavior of the artboard.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- layoutScaleFactor → double
-
The layout scale factor of the artboard.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Whether to use a shared texture
(RivePanel) to draw the artboard to.final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< RiveWidget> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited