NeedlePointer constructor
const
NeedlePointer({
- Key? key,
- double value = 0,
- bool enableDragging = false,
- ValueChanged<
double> ? onValueChanged, - ValueChanged<
double> ? onValueChangeStart, - ValueChanged<
double> ? onValueChangeEnd, - ValueChanged<
ValueChangingArgs> ? onValueChanging, - KnobStyle? knobStyle,
- TailStyle? tailStyle,
- LinearGradient? gradient,
- double needleLength = 0.6,
- GaugeSizeUnit lengthUnit = GaugeSizeUnit.factor,
- double needleStartWidth = 1,
- double needleEndWidth = 10,
- NeedlePointerRendererFactory<
NeedlePointerRenderer> ? onCreatePointerRenderer, - bool enableAnimation = false,
- double animationDuration = 1000,
- AnimationType animationType = AnimationType.ease,
- Color? needleColor,
Create a needle pointer with the default or required properties.
The arguments value
, must not be null and animationDuration
,
needleLength
, needleStartWidth
, needleEndWidth
must be non-negative.
Implementation
const NeedlePointer(
{Key? key,
this.value = 0,
this.enableDragging = false,
this.onValueChanged,
this.onValueChangeStart,
this.onValueChangeEnd,
this.onValueChanging,
KnobStyle? knobStyle,
this.tailStyle,
this.gradient,
this.needleLength = 0.6,
this.lengthUnit = GaugeSizeUnit.factor,
this.needleStartWidth = 1,
this.needleEndWidth = 10,
this.onCreatePointerRenderer,
this.enableAnimation = false,
this.animationDuration = 1000,
this.animationType = AnimationType.ease,
this.needleColor})
: knobStyle = knobStyle ?? const KnobStyle(),
assert(animationDuration > 0,
'Animation duration must be a non-negative value'),
assert(needleLength >= 0, 'Needle length must be greater than zero.'),
assert(needleStartWidth >= 0,
'Needle start width must be greater than zero.'),
assert(
needleEndWidth >= 0, 'Needle end width must be greater than zero.'),
super(key: key);