MarkerPointer constructor

const MarkerPointer(
  1. {Key? key,
  2. double value = 0,
  3. bool enableDragging = false,
  4. ValueChanged<double>? onValueChanged,
  5. ValueChanged<double>? onValueChangeStart,
  6. ValueChanged<double>? onValueChangeEnd,
  7. ValueChanged<ValueChangingArgs>? onValueChanging,
  8. AnimationType animationType = AnimationType.ease,
  9. bool enableAnimation = false,
  10. double animationDuration = 1000,
  11. MarkerType markerType = MarkerType.invertedTriangle,
  12. Color? color,
  13. double markerWidth = 10,
  14. double markerHeight = 10,
  15. double borderWidth = 0,
  16. double markerOffset = 0,
  17. String? text,
  18. Color? borderColor,
  19. GaugeSizeUnit offsetUnit = GaugeSizeUnit.logicalPixel,
  20. String? imageUrl,
  21. MarkerPointerRendererFactory<MarkerPointerRenderer>? onCreatePointerRenderer,
  22. GaugeTextStyle? textStyle,
  23. Color? overlayColor,
  24. double? overlayRadius,
  25. 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);