drawLeft method

void drawLeft(
  1. Canvas canvas,
  2. Size size,
  3. Paint paint
)

Implementation

void drawLeft(Canvas canvas, Size size, Paint paint) {
  RRect rect = RRect.fromLTRBR(
      0, 0, size.width - arrowSize! + elevation! / 2, size.height, radius!);
  Path path = Path()..addRRect(rect.shift(Offset(arrowSize!, 0)));
  canvas.drawShadow(path, Colors.grey.shade50, elevation!, true);
  canvas.drawRRect(
    RRect.fromLTRBR(arrowSize!, 0, size.width, size.height, radius!),
    paint,
  );

  double offset = arrowSize! + DEFAULT_OFFSET + arrowOffset!;
  if (arrowAlignment == ArrowAlignment.center) {
    offset = size.height / 2 + arrowOffset!;
  }
  if (arrowAlignment == ArrowAlignment.end) {
    offset = size.height - arrowSize! - DEFAULT_OFFSET - arrowOffset!;
  }

  path = Path()
    ..moveTo(0, offset)
    ..lineTo(arrowSize!, offset - arrowSize! / 3 * 2)
    ..lineTo(arrowSize!, offset + arrowSize! / 3 * 2);
  canvas.drawPath(path, paint);
}