VirtualPiano class

Inheritance

Constructors

VirtualPiano({Key? key, required RangeValues noteRange, List<HighlightedNoteSet>? highlightedNoteSets, dynamic onNotePressed(int, double)?, dynamic onNotePressSlide(int, double)?, dynamic onNoteReleased(int)?, Color whiteKeyColor = Colors.white, Color blackKeyColor = Colors.black, double elevation = 2, double borderWidth = 0.5, double keyHighlightColorBlend = 0.8, bool showKeyLabels = false})
const

Properties

blackKeyColor Color
The color to render black keys.
final
borderWidth double
The width of the border around each key
final
elevation double
The (material) elevation of the piano keys
final
hashCode int
The hash code for this object.
no setterinherited
highlightedNoteSets List<HighlightedNoteSet>?
A list of sets of notes to be highlighted (colored).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyHighlightColorBlend double
The blend between keys highlight color and base color
final
noteRange RangeValues
The range of notes to render on the Piano. Note ranges are defined by their MIDI note values, so a value of 0 equals C-1 and a value of 127 equals G9. Values outside of this 0..127 range are invalid.
final
onNotePressed → (dynamic Function(int, double)?)
Called when a key is pressed/touched. Parameters are the note of the key (int) and the vertical position of the touch on the key (double)
final
onNotePressSlide → (dynamic Function(int, double)?)
Called when a vertical drag/slide is performed on a key. Parameters are the note of the key (int) and the vertical position of the drag on the key (double)
final
onNoteReleased → (dynamic Function(int)?)
Called when a key is released.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showKeyLabels bool
Show key labels on the keys
final
whiteKeyColor Color
The color to render white keys.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<VirtualPiano>
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}) 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