WmaIndicator<T, D> constructor

WmaIndicator<T, D>({
  1. bool isVisible = true,
  2. String? xAxisName,
  3. String? yAxisName,
  4. String? seriesName,
  5. List<double> dashArray = const <double>[0, 0],
  6. double animationDuration = 1500,
  7. double animationDelay = 0,
  8. List<T>? dataSource,
  9. ChartValueMapper<T, D>? xValueMapper,
  10. ChartValueMapper<T, num>? highValueMapper,
  11. ChartValueMapper<T, num>? lowValueMapper,
  12. ChartValueMapper<T, num>? openValueMapper,
  13. ChartValueMapper<T, num>? closeValueMapper,
  14. String? name,
  15. bool isVisibleInLegend = true,
  16. LegendIconType legendIconType = LegendIconType.seriesType,
  17. String? legendItemText,
  18. Color signalLineColor = Colors.blue,
  19. double signalLineWidth = 2,
  20. int period = 14,
  21. String valueField = 'close',
  22. ChartIndicatorRenderCallback? onRenderDetailsUpdate,
})

Creating an argument constructor of WmaIndicator class.

Implementation

WmaIndicator({
  super.isVisible,
  super.xAxisName,
  super.yAxisName,
  super.seriesName,
  super.dashArray,
  super.animationDuration,
  super.animationDelay,
  super.dataSource,
  ChartValueMapper<T, D>? xValueMapper,
  ChartValueMapper<T, num>? highValueMapper,
  ChartValueMapper<T, num>? lowValueMapper,
  ChartValueMapper<T, num>? openValueMapper,
  ChartValueMapper<T, num>? closeValueMapper,
  super.name,
  super.isVisibleInLegend,
  super.legendIconType,
  super.legendItemText,
  super.signalLineColor,
  super.signalLineWidth,
  this.period = 14,
  this.valueField = 'close',
  super.onRenderDetailsUpdate,
}) : super(
        xValueMapper: xValueMapper != null && dataSource != null
            ? (int index) => xValueMapper(dataSource[index], index)
            : null,
        highValueMapper: highValueMapper != null && dataSource != null
            ? (int index) => highValueMapper(dataSource[index], index)
            : null,
        lowValueMapper: lowValueMapper != null && dataSource != null
            ? (int index) => lowValueMapper(dataSource[index], index)
            : null,
        openValueMapper: openValueMapper != null && dataSource != null
            ? (int index) => openValueMapper(dataSource[index], index)
            : null,
        closeValueMapper: closeValueMapper != null && dataSource != null
            ? (int index) => closeValueMapper(dataSource[index], index)
            : null,
      );