createSkeletons method

  1. @override
List<Skeleton> createSkeletons(
  1. Element element,
  2. Rect elementRect,
  3. Rect? parentRect
)
override

Implementation

@override
List<Skeleton> createSkeletons(
  Element element,
  Rect elementRect,
  Rect? parentRect,
) {
  final List<Skeleton> skeletons = [];
  final BorderSide? borderSide = getBorderSide(element);
  if (borderSide == null) {
    return skeletons;
  }
  final backgroundSkeleton = createBackgroundSkeleton(
    element,
    elementRect,
    borderSide.width,
  );

  final borderSkeleton = WireframeUtils.skeletonsFromBorderRect(
    elementRect,
    borderSide.color,
    borderSide.width,
  );
  if (borderSkeleton != null) {
    skeletons.addAll(borderSkeleton);
  }

  if (backgroundSkeleton != null) {
    skeletons.add(backgroundSkeleton);
  }

  return skeletons;
}