RistoShimmer class
A unified widget that applies a smooth shimmering gradient effect. It acts as a wrapper for custom children, or can generate pre-built skeleton shapes (blocks, circles, text lines) via its static methods.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RistoShimmer
Constructors
- RistoShimmer({Key? key, required Widget child, Color? baseColor, Color? highlightColor, Duration duration = const Duration(milliseconds: 1500)})
-
const
- RistoShimmer.dark({Key? key, required Widget child, Duration duration = const Duration(milliseconds: 1500)})
-
A pre-configured shimmer for dark-themed interfaces.
factory
- RistoShimmer.fromColor({Key? key, required Widget child, required Color color, double lightnessFactor = 0.4, Duration duration = const Duration(milliseconds: 1500)})
-
Automatically generates the highlight sweeping color based on a single base color.
factory
- RistoShimmer.light({Key? key, required Widget child, Duration duration = const Duration(milliseconds: 1500)})
-
A pre-configured shimmer for light-themed interfaces.
factory
Properties
- baseColor → Color?
-
final
- child → Widget
-
final
- duration → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightColor → Color?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< RistoShimmer> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
Static Methods
-
block(
{double? width, double? height, double borderRadius = 8.0, EdgeInsetsGeometry? margin, Color? staticColor, bool animated = true, Color? baseColor, Color? highlightColor}) → Widget - Generates a standard rectangular skeleton block, automatically shimmering.
- Generates a skeleton block styled like a standard button.
-
card(
{double? width, double? height, double borderRadius = 16.0, EdgeInsetsGeometry? margin, Color? staticColor, bool animated = true, Color? baseColor, Color? highlightColor}) → Widget - Generates a large card skeleton block.
-
circle(
{required double size, EdgeInsetsGeometry? margin, Color? staticColor, bool animated = true, Color? baseColor, Color? highlightColor}) → Widget - Generates a circular skeleton block (e.g., for avatars).
-
layoutButtonsAndCards(
{double buttonHeight = 54.0, double cardWidth = 140.0, double cardHeight = 160.0, double horizontalPadding = 16.0, double spacing = 12.0, int cardCount = 4, Color? staticColor, bool animated = true, Color? baseColor, Color? highlightColor}) → Widget - Replicates a complex layout with split top action buttons and a horizontal scrolling list of cards.
-
textLines(
{int lines = 2, double lineHeight = 14.0, double spacing = 8.0, bool lastLineShort = true, Color? staticColor, bool animated = true, Color? baseColor, Color? highlightColor}) → Widget - Generates a layout of multiple skeleton text lines. Wraps all lines in a SINGLE shimmer so the sweep effect travels across them seamlessly.