Dial class

Creates a widget that acts as a dial.

When focused, the dial will display a control ring of ringWidth logical pixels If clip is true, panning off of this ring will end the current pan, otherwise panning outside of the widget will continue to update the dial.

The supplied image will not be rotated in order to preserve visual characteristics. Use indicatorColor, indicatorWidth, and indicatorLength to simulate rotation.

If hotColor is null, the control ring will be color color, otherwise it will be a gradient of color, hotColor, with opacity applied.

The initial precentage on creation of the widget is supplied through value 0,100

The dial may be oriented clockwise or counterclockwise via clockwise. and the mounting orientation is supplied via orientation in degrees from bottom, typically -180, 180.

If stopCount is zero, it is infinitely dialable withing 0,360 degrees, if non-zero, the dial will dial to stopCount evenly spaced stops.

Inheritance

Constructors

Dial({Key? key, double value = 0.0, required Image image, required double size, required double ringWidth, required Color color, Color? hotColor, double opacity = 1.0, int stopCount = 0, bool clip = false, bool clockwise = true, double orientation = 0.0, Color? indicatorColor, double indicatorWidth = 1.0, double? indicatorLength, void onDialed(double degrees, double percent, int stopNumber)?, void onFocusChange(bool focused)?})
Creates an Dial

Properties

clip bool
Set to true to end panning when outside of the control ring. Default - false
final
clockwise bool
Panning direction to increase the dials value. Set to true to pan clockwise, false for counterclockwise. default - true.
final
color Color
The color of the control ring if hotColor is null, otherwise the cool color (low values) side of the control rings gradient.
final
hashCode int
The hash code for this object.
no setterinherited
hotColor Color?
If non-null, the hot color (high values) side of the control ring.
final
image Image
The image used for the dial.
final
indicatorColor Color?
The color of the dial position indicator line. The position indicator will be transparent if not specified
final
indicatorLength double?
The length of the dial indicator line in loogical pixels. If over dial radius, it will be set equal dial radius.
final
indicatorWidth double
This width of the dial indicator line in logical pixels. Default 1.0
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDialed → void Function(double degrees, double percent, int stopNumber)?
Called when the dial is turned via the panning on the control ring.
final
onFocusChange → void Function(bool focused)?
Called when the focus changes.
final
opacity double
The opacity of the control ring
final
orientation double
The mounting orientation of the dial in degrees counterclockwise. 0.0 is bottom oriented, 180.0 is top oriented. Default 0.0
final
ringWidth double
The width of the control ring in logical pixels. If larger than the calculated radius of the dial, this will be set to the radius of the dial.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double
The size of the widget, Size(size,size) in logical pixels.
final
stopCount int
The number of non-zero evenly placed stops around the dial. If <= zero, there are no stops and the dial is infinite on 0.0,360.0 eg) stopCount: 10 will result in a stop at "zero" and 10 subsequent evenly distributed radial stops at degrees (36, 72, 108, ... 360)
final
value double
The percentage value of the control ring on creation.
final

Methods

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