excludeSkeleton method

Widget excludeSkeleton({
  1. bool exclude = true,
})

Controls whether the widget should be preserved in skeleton mode.

Wraps the widget with Skeleton.keep to conditionally preserve the original widget appearance when skeleton effects are active. When exclude is true, the widget maintains its normal appearance instead of being skeletonized.

Parameters:

  • exclude (bool, default: true): Whether to exclude from skeleton effects

Returns: A Skeleton.keep wrapper that conditionally preserves the widget's appearance.

Example:

Row(children: [
  Text('Data: $value'),
  Icon(Icons.star).excludeSkeleton(exclude: isImportant),
]).asSkeleton();

Implementation

Widget excludeSkeleton({bool exclude = true}) {
  return Skeleton.keep(keep: exclude, child: this);
}