skeletonsFromBorderRect static method

List<Skeleton>? skeletonsFromBorderRect(
  1. Rect elementRect,
  2. Color color,
  3. double width
)

Implementation

static List<Skeleton>? skeletonsFromBorderRect(
  Rect elementRect,
  Color color,
  double width,
) {
  if (width.toInt() == 0) {
    return null;
  }

  return [
    Skeleton(
      rect: Rect.fromLTWH(
        elementRect.left,
        elementRect.top,
        elementRect.width,
        width,
      ),
      color: color,
    ),
    Skeleton(
      rect: Rect.fromLTWH(
        elementRect.left,
        elementRect.bottom,
        elementRect.width,
        width,
      ),
      color: color,
    ),
    Skeleton(
      rect: Rect.fromLTWH(
        elementRect.left,
        elementRect.top,
        width,
        elementRect.height,
      ),
      color: color,
    ),
    Skeleton(
      rect: Rect.fromLTWH(
        elementRect.right,
        elementRect.top,
        width,
        elementRect.height,
      ),
      color: color,
    ),
  ];
}