DepthChartPainter constructor

DepthChartPainter(
  1. List<DepthEntity>? mBuyData,
  2. List<DepthEntity>? mSellData,
  3. Offset? pressOffset,
  4. bool isLongPress,
  5. int? fixedLength,
  6. Color? mBuyPathColor,
  7. Color? mSellPathColor,
  8. DepthColors colors,
)

Implementation

DepthChartPainter(
  this.mBuyData,
  this.mSellData,
  this.pressOffset,
  this.isLongPress,
  this.fixedLength,
  this.mBuyPathColor,
  this.mSellPathColor,
  this.colors
) {
  mBuyLinePaint ??= Paint()
    ..isAntiAlias = true
    ..color = colors.buy
    ..style = PaintingStyle.stroke
    ..strokeWidth = 1.0;
  mSellLinePaint ??= Paint()
    ..isAntiAlias = true
    ..color = colors.sell
    ..style = PaintingStyle.stroke
    ..strokeWidth = 1.0;

  mBuyPathPaint ??= Paint()
    ..isAntiAlias = true
    ..color = (mBuyPathColor == null
        ? colors.buy.withValues(alpha: 0.2)
        : mBuyPathColor)!;
  mSellPathPaint ??= Paint()
    ..isAntiAlias = true
    ..color = (mSellPathColor == null
        ? colors.sell.withValues(alpha: 0.2)
        : mSellPathColor)!;
  mBuyPath ??= Path();
  mSellPath ??= Path();
  init();
}