SkeletonExtension extension

Extension methods for adding skeleton loading effects to any widget.

SkeletonExtension provides convenient methods to transform regular widgets into skeleton loading states with proper animation and theming integration. These methods work with the underlying Skeletonizer package while ensuring consistency with the shadcn design system.

The extension handles common use cases including content loading, image placeholders, form field loading, and complex layout skeletonization. Different skeleton modes (sliver, leaf, unite, replace) provide flexibility for various UI patterns and performance requirements.

Methods automatically detect certain widget types (Avatar, Image) and apply appropriate skeleton handling to avoid common rendering issues.

on

Methods

asSkeleton({bool enabled = true, bool leaf = false, Widget? replacement, bool unite = false, AsyncSnapshot? snapshot}) Widget

Available on Widget, provided by the SkeletonExtension extension

Converts the widget to a skeleton with advanced configuration options.
asSkeletonSliver({bool enabled = true}) Widget

Available on Widget, provided by the SkeletonExtension extension

Converts the widget to a skeleton suitable for sliver layouts.
excludeSkeleton({bool exclude = true}) Widget

Available on Widget, provided by the SkeletonExtension extension

Controls whether the widget should be preserved in skeleton mode.
ignoreSkeleton() Widget

Available on Widget, provided by the SkeletonExtension extension

Excludes the widget from skeleton effects in its parent skeleton context.