MarkerPointer constructor
const
MarkerPointer({
- Key? key,
- double value = 0,
- bool enableDragging = false,
- ValueChanged<
double> ? onValueChanged, - ValueChanged<
double> ? onValueChangeStart, - ValueChanged<
double> ? onValueChangeEnd, - ValueChanged<
ValueChangingArgs> ? onValueChanging, - AnimationType animationType = AnimationType.ease,
- bool enableAnimation = false,
- double animationDuration = 1000,
- MarkerType markerType = MarkerType.invertedTriangle,
- Color? color,
- double markerWidth = 10,
- double markerHeight = 10,
- double borderWidth = 0,
- double markerOffset = 0,
- String? text,
- Color? borderColor,
- GaugeSizeUnit offsetUnit = GaugeSizeUnit.logicalPixel,
- String? imageUrl,
- MarkerPointerRendererFactory<
MarkerPointerRenderer> ? onCreatePointerRenderer, - GaugeTextStyle? textStyle,
- Color? overlayColor,
- double? overlayRadius,
- double elevation = 0,
Create a marker pointer with the default or required properties.
The arguments value
, markerOffset
, must not be null and
animationDuration
, markerWidth
, markerHeight
, borderWidth
must be non-negative.
Implementation
const MarkerPointer({
Key? key,
this.value = 0,
this.enableDragging = false,
this.onValueChanged,
this.onValueChangeStart,
this.onValueChangeEnd,
this.onValueChanging,
this.animationType = AnimationType.ease,
this.enableAnimation = false,
this.animationDuration = 1000,
this.markerType = MarkerType.invertedTriangle,
this.color,
this.markerWidth = 10,
this.markerHeight = 10,
this.borderWidth = 0,
this.markerOffset = 0,
this.text,
this.borderColor,
this.offsetUnit = GaugeSizeUnit.logicalPixel,
this.imageUrl,
this.onCreatePointerRenderer,
GaugeTextStyle? textStyle,
this.overlayColor,
this.overlayRadius,
this.elevation = 0,
}) : textStyle = textStyle ?? const GaugeTextStyle(),
assert(animationDuration > 0,
'Animation duration must be a non-negative value.'),
assert(markerWidth >= 0, 'Marker width must be a non-negative value.'),
assert(markerHeight >= 0, 'Marker height must be non-negative value.'),
assert(borderWidth >= 0, 'Border width must be non-negative value.'),
assert(
elevation >= 0, 'Shadow elevation must be a non-negative value.'),
super(key: key);