CsSkeleton class

Cloudscape's Skeleton: a placeholder shaped like the content that is loading, so the layout does not jump when it arrives.

A text skeleton is one line tall (the line height of variant) with a bar the height of the font inside it, like a line of text. Give it an explicit height for blocks such as charts or images.

const CsSkeleton(variant: CsSkeletonVariant.textHeadingM, width: 180)
const CsSkeleton(height: 120)

// Show the skeleton while loading, then cross-fade to the content:
CsSkeleton(loading: _loading, child: InstanceSummary(instance))

A soft wave crosses the bar every 1.25s while it is on screen. The wave stops when the skeleton leaves the screen or is replaced by child, and is off under reduced motion, where the bar stays still. Skeletons are hidden from screen readers; announce loading with the surrounding component's loading text or a CsLiveRegion.

Inheritance

Constructors

CsSkeleton({Key? key, CsSkeletonVariant variant = CsSkeletonVariant.dynamic, double? width, double? height, bool loading = true, Widget? child})
const

Properties

child → Widget?
The content the skeleton stands in for.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double?
Height of the bar, for block placeholders. Defaults to the font size of variant inside a box one line tall.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loading → bool
While true the skeleton shows; when it turns false the skeleton cross-fades to child. Only meaningful with a child.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
variant → CsSkeletonVariant
Which text step the skeleton matches. Ignored when height is set.
final
width → double?
Width of the bar. Defaults to the available width (Cloudscape's inline-size: 100%), or 160 where the width is unbounded, as in a Row.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited