InteractiveBodyWidget class
A complete interactive body selector widget with built-in controller.
This widget provides a ready-to-use body selector with front/back view toggle and muscle selection capabilities. The package includes default SVG assets, so you can use it without specifying asset paths.
Example (simplest usage):
InteractiveBodyWidget(
onMuscleSelected: (muscle) {
print('Selected: $muscle');
},
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- InteractiveBodyWidget
Constructors
-
InteractiveBodyWidget({Key? key, String? frontAsset, String? backAsset, dynamic onMuscleSelected(Muscle)?, VoidCallback? onSelectionCleared, Set<
Muscle> ? selectedMuscles, bool initialIsFront = true, Color? highlightColor, Color? baseColor, double selectedStrokeWidth = 2.0, double unselectedStrokeWidth = 1.0, bool enableSelection = true, BoxFit fit = BoxFit.contain, double hitTestPadding = 10.0, double? width, double? height, Alignment alignment = Alignment.center, bool showFlipButton = true, bool showClearButton = true, PreferredSizeWidget? appBar, Color? backgroundColor, Widget selectedMusclesHeader(Set<Muscle> )?}) -
const
Properties
- alignment → Alignment
-
Alignment of the SVG
final
- appBar → PreferredSizeWidget?
-
Custom app bar
final
- backAsset → String?
-
Asset path for the back body SVG
Defaults to the package's included back body SVG
final
- backgroundColor → Color?
-
Background color
final
- baseColor → Color?
-
Base color for unselected muscles
final
- enableSelection → bool
-
Whether selection is enabled
final
- fit → BoxFit
-
How the SVG should be fitted
final
- frontAsset → String?
-
Asset path for the front body SVG
Defaults to the package's included front body SVG
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Height of the widget
final
- highlightColor → Color?
-
Color to highlight selected muscles
final
- hitTestPadding → double
-
Padding for hit-testing
final
- initialIsFront → bool
-
Initial view (front or back)
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onMuscleSelected → dynamic Function(Muscle)?
-
Callback when a muscle is selected
final
- onSelectionCleared → VoidCallback?
-
Callback when selection is cleared
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedMuscles
→ Set<
Muscle> ? -
Currently selected muscles (for programmatic control) - multi-select only
final
-
selectedMusclesHeader
→ Widget Function(Set<
Muscle> )? -
Custom header widget to show selected muscles
final
- selectedStrokeWidth → double
-
Stroke width for selected muscles
final
- showClearButton → bool
-
Show clear button in app bar
final
- showFlipButton → bool
-
Show flip button in app bar
final
- unselectedStrokeWidth → double
-
Stroke width for unselected muscles
final
- width → double?
-
Width of the widget
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< InteractiveBodyWidget> -
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