SpriteStudioStateView class
A SpriteStudioView that shows the state of the button it sits in.
Give it the statesController the host button takes — InkWell and every
ButtonStyleButton accept one — and it plays the section each state calls
for, as SsUiStateDriver describes: hovered, pressed, disabled and
focused map to SsUiState.hover, SsUiState.pressed,
SsUiState.disabled and SsUiState.focused, one at a time in that order of
precedence, and none of them to SsUiState.normal.
The button keeps its role, its gestures and its focus; this only draws. To make it take taps on its artwork only, wrap the button in a SpriteStudioHitRegion.
final states = WidgetStatesController();
InkWell(
statesController: states,
onTap: _start,
child: SpriteStudioStateView(
player: _player,
statesController: states,
semanticLabel: 'Start',
),
)
It takes player's playback over while it is mounted.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SpriteStudioStateView
Constructors
-
SpriteStudioStateView({Key? key, required SpriteStudioPlayer player, required WidgetStatesController statesController, String? animation, Map<
SsUiState, SsUiClip> clips = const {}, bool? reducedMotion, String? semanticLabel, double? width, double? height, BoxFit fit = BoxFit.contain, AlignmentGeometry alignment = Alignment.center, Rect? frame}) -
const
Properties
- alignment → AlignmentGeometry
-
See SpriteStudioView.alignment.
final
- animation → String?
-
See SsUiStateDriver.animation.
final
-
clips
→ Map<
SsUiState, SsUiClip> -
See SsUiStateDriver.clips.
final
- fit → BoxFit
-
See SpriteStudioView.fit.
final
- frame → Rect?
-
See SpriteStudioView.frame.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
See SpriteStudioView.height.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- player → SpriteStudioPlayer
-
final
- reducedMotion → bool?
-
Whether to hold still. Null follows MediaQuery.disableAnimationsOf.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
A label for screen readers, read as an image's would be — as
Image.semanticLabel is. Null leaves the drawing out of the semantics
tree, as decoration.
final
- statesController → WidgetStatesController
-
The states of the button, shared with it.
final
- width → double?
-
See SpriteStudioView.width.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SpriteStudioStateView> -
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