fillRect method

void fillRect(
  1. Canvas canvas,
  2. Color color,
  3. int left,
  4. int top,
  5. int width,
  6. int height,
)

Implementation

void fillRect(Canvas canvas, Color color, int left, int top, int width, int height) {
  try {
    final rect = Rect.fromLTWH(left.toDouble(), top.toDouble(), width.toDouble(), height.toDouble());
    final paint = Paint()
      ..color = color
      ..style = PaintingStyle.fill;

    canvas.drawRect(rect, paint);
  } catch (e) {
    print("DiveAudioMeterPainter.fillRect exception: $e");
  }
}