drawSelectionBand function

void drawSelectionBand(
  1. Canvas canvas,
  2. Rect rect, {
  3. required Color fill,
  4. required Color border,
})

A translucent drag range-selection band over rect.

Implementation

void drawSelectionBand(
  Canvas canvas,
  Rect rect, {
  required Color fill,
  required Color border,
}) {
  if (rect.width <= 0 || rect.height <= 0) return;
  canvas
    ..drawRect(rect, Paint()..color = fill)
    ..drawRect(
      rect,
      Paint()
        ..color = border
        ..style = PaintingStyle.stroke
        ..strokeWidth = 1,
    );
}